WO2018058873A1 - Photographing method and device - Google Patents

Photographing method and device Download PDF

Info

Publication number
WO2018058873A1
WO2018058873A1 PCT/CN2017/072583 CN2017072583W WO2018058873A1 WO 2018058873 A1 WO2018058873 A1 WO 2018058873A1 CN 2017072583 W CN2017072583 W CN 2017072583W WO 2018058873 A1 WO2018058873 A1 WO 2018058873A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
preview
photographing
spectrum
original image
Prior art date
Application number
PCT/CN2017/072583
Other languages
French (fr)
Chinese (zh)
Inventor
董德
金武超
Original Assignee
宇龙计算机通信科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宇龙计算机通信科技(深圳)有限公司 filed Critical 宇龙计算机通信科技(深圳)有限公司
Publication of WO2018058873A1 publication Critical patent/WO2018058873A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a photographing method and apparatus.
  • the color that the user sees with the naked eye or the photo taken by the camera or the color in the image loses the white balance, and cannot display its original color.
  • a series of white balance processing such as color reproduction or tone processing can be performed on the photo.
  • the existing white balance processing is limited to the adjustment of the ratio of red, blue and green in the image after photographing or the manual use of the standard reference by the user, the former does not achieve the ideal white balance effect, the latter It is very inconvenient in the process of use, and the user cannot carry certain standard reference objects and prepared placement positions every time, so that the corresponding white balance effect is not satisfactory.
  • the white balance method of color distortion in the case of the existing natural light is not a natural spectrum, and the stability and the effectiveness of the white balance effect are insufficient.
  • the method includes:
  • the preview image is displayed on the first image preview area preset on the shooting preview interface.
  • the device includes:
  • An original image acquisition module configured to acquire an original image acquired by the camera when entering the shooting preview interface
  • An ambient light spectrum detecting module for detecting an ambient light spectrum by the spectral sensor
  • a compensation spectrum acquisition module configured to acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum
  • a preview image acquisition module configured to perform spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image
  • a preview image display module is configured to display a preview image in a first image preview area preset on the shooting preview interface.
  • the image displayed on the shooting preview interface is not the image directly captured by the camera, but the image after white balance processing on the image captured by the camera, and white balance is performed on the image captured by the camera.
  • it is the ambient light obtained from the spectral sensor
  • the difference between the spectrum and the standard white light spectrum determines the specific parameters and data of the processed white balance processing, so that the color displayed on the image displayed on the shooting preview interface and the image taken or captured is the color of the object.
  • the color distortion existing in the image can be automatically analyzed and the corresponding color distortion phenomenon is corrected, the operation convenience of the image white balance processing is improved, and the white balance processing is improved. Accuracy and effectiveness.
  • FIG. 1 is a schematic flow chart of a photographing method in an embodiment
  • FIG. 2 is a schematic structural view of a photographing device in an embodiment
  • FIG. 3 is a schematic structural diagram of a computer device that runs the aforementioned photographing method in one embodiment.
  • the implementation of the method may rely on a computer program that can run on a computer system based on the von Neumann system, which can be an application for a camera application or a video application.
  • the computer system may be a server or terminal such as a smartphone, tablet, personal computer or the like that runs the above computer program.
  • the terminal is based on the method for controlling the flash.
  • a spectral sensor is placed. Specifically, the spectral sensor can detect the spectrum corresponding to the ambient light, that is, determine the distribution of the ambient light rays at various wavelengths or frequencies after performing the splitting, or the distribution under the respective colors after the splitting.
  • the foregoing photographing method includes the following steps S102-S110:
  • Step S102 Acquire an original image acquired by the camera when entering the shooting preview interface.
  • the photograph taken can present the real situation of the object being photographed, that is, the color of the photographed object in the photographed image is white balance, and there is no problem of color distortion or chromatic aberration. .
  • the user can open the camera application by clicking the application icon corresponding to the camera and enter the shooting preview interface, and the image captured by the camera is displayed on the shooting preview interface.
  • the original image captured by the camera is not displayed on the shooting preview interface, but the image after the white balance processing.
  • Step S104 detecting an ambient light spectrum by the spectral sensor
  • Step S106 Acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum.
  • the spectrum sensor can detect the spectrum corresponding to the ambient light, so that it is known whether there is any light source other than the natural light in the current ambient light, especially whether the white light balance is included in the light source existing in the ambient light.
  • a natural light reference spectrum under standard natural light is prestored in the terminal, and the natural light reference spectrum corresponds to a standard white light spectrum in a white equilibrium state.
  • the ambient light spectrum If there is a difference between the ambient light spectrum and the natural light reference spectrum, it indicates that there is currently a light source or other object that affects the white balance in the ambient light, that is, in the current environment, the object seen by the user's naked eye may have color distortion.
  • the phenomenon, or the color of an image taken in the current environment may have a color difference from its true color.
  • the degree of color distortion or the magnitude of the chromatic aberration described above can be determined by the difference between the ambient light spectrum and the natural light reference spectrum. Moreover, since the present embodiment is for presenting the original color of the article under ambient light, it is necessary to determine what kind of pipeline should be added under the current environment in order to make the light in the current environment appear white balance.
  • Step S108 performing spectral superposition processing and/or spectral filtering processing on the original image on the compensation spectrum to obtain a preview image;
  • Step S110 displaying a preview image in a first image preview area preset on the shooting preview interface.
  • the ambient light spectrum If there is a difference between the ambient light spectrum and the natural light reference spectrum, it means that the current ambient light causes the color difference exhibited by the object to be photographed, that is, if it is desired to obtain an image without chromatic aberration, it is necessary to
  • the original image acquired by the camera is white balanced, and the final image after the white balance processing is the desired preview image, for example, a preview interface displayed on the shooting preview interface.
  • the white balance processing performed on the original image acquired by the camera is determined according to the compensation spectrum, that is, according to the difference between the natural light reference spectrum and the ambient light spectrum, The specific situation of the color difference existing on the original image, and then the color difference is specifically processed.
  • the spectral superposition is performed on the original image according to the compensation spectrum, and the spectrum under the natural light reference spectrum can be obtained by spectral superposition of the ambient light spectrum and the compensation spectrum, that is, finally, the spectral superposition is performed.
  • the original image afterwards is white balanced, that is, there is no color distortion or chromatic aberration.
  • the processing of the original image may also be performed by spectral filtering. Specifically, according to the difference between the ambient light spectrum and the natural light reference spectrum, unnecessary data other than the natural light reference spectrum on the original image is determined, and the excess spectrum is adjusted, and finally the natural light is obtained. The image under the reference spectrum.
  • the processed original image exhibits a white balance, that is, there is no color distortion or chromatic aberration in the color presented in the processed preview image.
  • the row operation can be performed, and if the preview image displayed on the shooting preview interface is displayed, the preview image displayed by the user is desired. Or if the user's needs are met, the user can obtain the preview image as a photographed image by inputting a photographing instruction and store the photographed image.
  • the method further includes: receiving an input photographing instruction, acquiring the preview image as a photographing image according to the photographing instruction, and storing the photographed image.
  • the foregoing method is not limited to the storage of a photograph or a single image, and is also applicable to the acquisition and display of an image frame during the recording process.
  • the color displayed by the image processed by the above white balance is the true color of the displayed object, the user may also have a desire to present a warm color, a cool color, or other requirements, so that when the user takes a photo, The original image acquired in step S102 can be selected.
  • the displaying the preview image on the shooting preview interface further includes: displaying the original image in a second image preview area preset on the shooting preview interface.
  • both the original image without white balance processing and the preview image after white balance processing are displayed, so that the user can compare the two images, for example, which image is selected as the final save. Image.
  • the method further includes: acquiring a target image selection instruction input by the user;
  • the target image selection instruction acquires a preview image or an original image corresponding to the target image selection instruction as a target image; the target image is taken as a photographed image and stored.
  • the user can select the original image and the preview image to be displayed, for example, select a target image by a click operation or other preset operation, and select the user during the process of taking a photo or recording.
  • the target image is used as the final stored image.
  • a white balance switch component is further displayed on the shooting preview interface, and the white balance switch component can be used by the user to select whether to perform white balance processing on the original image acquired by the camera.
  • a fine-tuning component is also displayed on the shooting preview interface, and the user can adjust the specific white balance effect through the fine-tuning component.
  • the method further includes receiving an input white balance adjustment instruction by the fine adjustment component, and adjusting the white balance according to the instruction.
  • the user needs to have a warmer hue, and the current display effect is white balance.
  • the user can input a specific adjustment request by clicking the fine-tuning control page displayed by the fine-tuning component, that is, the corresponding adjustment data in the white balance adjustment command input by the user.
  • the adjustment data input by the user it can be determined
  • spectral data specifically added in the process of spectral filtering or spectral superposition or specifically filtered spectral data is performed.
  • the user When taking a photo, the user may be concerned with the presentation of the color corresponding to the subject being photographed, that is to say, for other parts of the color user, in the process of white balance processing, in order to save the white balance process
  • the amount of calculation can be processed only for a partial area in the image, for example, only the foreground area or the area selected by the user can be processed.
  • the step of performing spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image further includes: acquiring a foreground region of the original image; and corresponding to the compensation spectrum
  • the foreground region of the original image is subjected to spectral superposition processing and/or spectral filtering processing to obtain a foreground region of the preview image; the preview image is obtained according to a foreground region of the preview image and a non-foreground region of the original image.
  • the foreground area or the selected area is determined by the original image subjected to spectral superposition processing and/or spectral filtering processing, and other The area is the corresponding area in the original image.
  • the present invention also provides a photographing apparatus, including an original image acquisition module 102, an ambient light spectrum detection module 104, a compensation spectrum acquisition module 106, a preview image acquisition module 108, and a preview image display module 110, wherein:
  • the device is based on a terminal provided with a spectral sensor
  • the device includes:
  • the original image obtaining module 102 is configured to acquire an original image collected by the camera when entering the shooting preview interface;
  • An ambient light spectrum detecting module 104 configured to detect an ambient light spectrum by the spectral sensor
  • a compensation spectrum acquisition module 106 configured to acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
  • a preview image obtaining module 108 configured to perform spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image
  • the preview image display module 110 is configured to display a preview image in a first image preview area preset on the shooting preview interface.
  • the foregoing apparatus further includes a photographing image acquiring module 112, configured to receive an input photographing instruction, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
  • a photographing image acquiring module 112 configured to receive an input photographing instruction, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
  • the preview image display module 108 is further configured to display the original image in a second image preview area preset on the shooting preview interface.
  • the foregoing apparatus further includes a target image selection module 114, configured to acquire a target image selection instruction input by a user, and acquire the target image according to the target image selection instruction.
  • the preview image or the original image corresponding to the instruction is selected as the target image; the target image is taken as a photographed image and stored.
  • the preview image obtaining module 108 is further configured to acquire a foreground region of the original image, and perform spectral superposition processing and/or spectral filtering processing on a foreground region of the original image corresponding to the compensation spectrum. Obtaining a foreground area of the preview image; obtaining the preview image according to a foreground area of the preview image and a non-foreground area of the original image.
  • the shooting preview interface is provided with a fine adjustment component; as shown in FIG. 2, the apparatus further includes a fine adjustment module 116, configured to receive an input white balance adjustment instruction by the fine adjustment component, according to The instructions adjust the white balance.
  • the image displayed on the shooting preview interface is not the image directly captured by the camera, but the image after white balance processing on the image captured by the camera, and white balance is performed on the image captured by the camera.
  • the specific parameters and data of the processed white balance processing are determined according to the difference between the ambient light spectrum acquired by the spectral sensor and the standard white light spectrum, so that the image displayed on the shooting preview interface and the photographing or acquiring are obtained.
  • the color that the image presents is the color of the object's display rather than the color distortion.
  • the color distortion existing in the image can be automatically analyzed and the corresponding color distortion phenomenon is corrected, the operation convenience of the image white balance processing is improved, and the white balance processing is improved. Accuracy And effectiveness.
  • FIG. 3 illustrates a terminal of a von Neumann system-based computer system that operates the above-described photographing method.
  • the computer system may be a terminal device equipped with a spectrum sensor such as a smartphone, a tablet, a palmtop, a laptop, or a personal computer.
  • a spectrum sensor such as a smartphone, a tablet, a palmtop, a laptop, or a personal computer.
  • an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included.
  • the external input interface 1001 can optionally include at least a network interface 10012.
  • the memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034.
  • the output interface 1004 can include at least a device such as a display 10042.
  • the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned von Neumann system-based computer system, loaded into the internal memory 10034 at runtime, and then After being compiled into a machine code, it is passed to the processor 1002 for execution, so that the logical original image acquisition module 102, the ambient light spectrum detection module 104, the compensation spectrum acquisition module 106, and the preview are formed in the von Neumann system-based computer system.
  • the input parameters are all received through the external input interface 1001, and transferred to the buffer in the memory 1003, and then input to the processor 1002 for processing, and the processed result data is cached in the memory 1003 for subsequent processing.
  • the ground is processed or passed to the output interface 1004 for output.
  • processor 1002 is specifically configured to perform the following steps:
  • the preview image is displayed on the first image preview area preset on the shooting preview interface.
  • the processor 1002 is further configured to execute a photographing instruction for receiving an input, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
  • the processor 1002 is further configured to execute in the shooting preview field.
  • the second image preview area preset on the surface displays the original image.
  • the processor 1002 is further configured to: execute a target image selection instruction for acquiring a user input; and acquire, according to the target image selection instruction, a preview image or an original image corresponding to the target image selection instruction. a target image; the target image is taken as a photographed image and stored.
  • the processor 1002 is further configured to perform acquiring a foreground area of the original image, and performing spectral superposition processing and/or spectral filtering processing on a foreground area of the original image corresponding to the compensation spectrum.
  • the processor 1002 is further configured to execute a white balance adjustment instruction that receives an input through the fine adjustment component, and adjusts the white balance according to the instruction.

Abstract

Disclosed in an embodiment of the present invention are a photographing method and device, both of which are based on a terminal provided with a spectrum sensor, wherein the method comprises: acquiring an original image collected by a camera when entering a photographing preview interface; detecting the ambient light spectrum by the spectrum sensor; acquiring a pre-stored natural light reference spectrum, and calculating a difference between the ambient light spectrum and the natural light reference spectrum as a compensated spectrum; performing spectral superposition processing on the original image and/or spectrum filtering process by using the compensated spectrum to obtain a preview image; displaying the preview image in a preset first image preview area on the photographing preview interface. With the present invention, the white balance effect of the photographed image can be improved.

Description

拍照方法及装置Photographing method and device
本申请要求于2016年9月29日提交中国专利局、申请号为201610871676.7、发明名称为“拍照方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, filed on Sep. 29, 2016, the filing date of
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种拍照方法及装置。The present invention relates to the field of computer technologies, and in particular, to a photographing method and apparatus.
背景技术Background technique
在生活中,商家经常会采用灯光效果对商店作氛围烘托,并对商品作色彩渲染,从而使得消费者在查看时对陈列的商品的色泽等更加满意或喜欢,以至消费者在购买商品时不能得到和判断商品的真实色泽和品质,容易出现在购买时觉得喜欢和满意,购买回家之后发现商品的颜色和品质与在商店看见时存在极大差别,买到的东西不是自己真正想要的。会出现上述问题的本质原因在于商家采用现场特定环境光线,对商品进行了渲染,从而误导了消费者。In life, merchants often use lighting effects to create an atmosphere for the store, and color rendering the products, so that consumers can be more satisfied or like the color of the displayed products when viewing, so that consumers can not buy goods. Obtaining and judging the true color and quality of the product, it is easy to appear in the purchase and feel satisfied and satisfied. After buying home, the color and quality of the product are very different from those seen in the store. The things you buy are not what you really want. . The essential reason for the above problems is that the merchants use the specific ambient light on the scene to render the goods, thus misleading the consumers.
也就是说,因为环境光线的影响,导致了用户肉眼看到的或者用摄像头拍下的照片或者影像中的色彩失去了白平衡,而不能展示其原本的色彩。为了还原被拍摄物的展示色彩,可以对照片进行一定的色彩还原或者色调处理等一系列的白平衡处理。但是,现有的白平衡处理仅限于在拍照之后对图像中的红蓝绿三色比例的调整或者用户手动的使用标准参考物之类的方式,前者达不到理想的白平衡效果,后者在使用的过程中非常不便,用户不可能每次都携带一定的标准参考物以及准备的摆放位置,从而使得其对应的白平衡效果也不理想。That is to say, because of the influence of ambient light, the color that the user sees with the naked eye or the photo taken by the camera or the color in the image loses the white balance, and cannot display its original color. In order to restore the display color of the subject, a series of white balance processing such as color reproduction or tone processing can be performed on the photo. However, the existing white balance processing is limited to the adjustment of the ratio of red, blue and green in the image after photographing or the manual use of the standard reference by the user, the former does not achieve the ideal white balance effect, the latter It is very inconvenient in the process of use, and the user cannot carry certain standard reference objects and prepared placement positions every time, so that the corresponding white balance effect is not satisfactory.
也就是说,在现有的针对环境光线不是自然光谱的情况下的色彩失真的白平衡方法存在的白平衡效果的稳定性以及有效性不足的问题。That is to say, the white balance method of color distortion in the case of the existing natural light is not a natural spectrum, and the stability and the effectiveness of the white balance effect are insufficient.
发明内容Summary of the invention
基于此,为解决传统技术中的针对环境光线不是自然光谱的情况下的色彩失真的白平衡方法存在的白平衡效果的稳定性以及有效性不足的技术问题,特 提出了一种拍照方法。Based on this, in order to solve the problem of the stability and the insufficient effectiveness of the white balance effect of the white balance method for the color distortion in the case where the ambient light is not the natural spectrum in the conventional technology, A method of photographing is proposed.
一种拍照方法,所述方法基于设置有光谱传感器的终端;A photographing method based on a terminal provided with a spectral sensor;
所述方法包括:The method includes:
在进入拍摄预览界面时,获取摄像头采集的原始图像;Obtain the original image captured by the camera when entering the shooting preview interface;
通过所述光谱传感器检测环境光光谱;Detecting an ambient light spectrum by the spectral sensor;
获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱;Obtaining a pre-stored natural light reference spectrum, and calculating a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;Performing spectral superposition processing and/or spectral filtering processing on the original image on the compensation spectrum to obtain a preview image;
在拍摄预览界面上预设的第一图像预览区域展示预览图像。The preview image is displayed on the first image preview area preset on the shooting preview interface.
此外,为解决传统技术中的针对环境光线不是自然光谱的情况下的色彩失真的白平衡方法存在的白平衡效果的稳定性以及有效性不足的技术问题,特提出了一种拍照装置。In addition, in order to solve the technical problem that the white balance method of the color distortion in the case where the ambient light is not the natural spectrum is stable and the effectiveness is insufficient, a photographing apparatus is proposed.
一种拍照装置,基于设置有光谱传感器的终端;A photographing device based on a terminal provided with a spectral sensor;
所述装置包括:The device includes:
原始图像获取模块,用于在进入拍摄预览界面时,获取摄像头采集的原始图像;An original image acquisition module, configured to acquire an original image acquired by the camera when entering the shooting preview interface;
环境光光谱检测模块,用于通过所述光谱传感器检测环境光光谱;An ambient light spectrum detecting module for detecting an ambient light spectrum by the spectral sensor;
补偿光谱获取模块,用于获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱;a compensation spectrum acquisition module, configured to acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
预览图像获取模块,用于将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;a preview image acquisition module, configured to perform spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image;
预览图像展示模块,用于在拍摄预览界面上预设的第一图像预览区域展示预览图像。A preview image display module is configured to display a preview image in a first image preview area preset on the shooting preview interface.
实施本发明实施例,将具有如下有益效果:Implementation of the embodiments of the present invention will have the following beneficial effects:
采用了上述拍照方法及装置之后,在拍摄预览界面上展示的图像,不是摄像头直接采集的图像,而是对摄像头采集的图像进行白平衡处理后的图像,并且,对摄像头采集的图像进行白平衡处理时,是根据光谱传感器获取的环境光 光谱与标准的白光光谱之间的差值却确定处理的白平衡处理的具体参数和数据,从而使得在在拍摄预览界面上展示的图像以及拍照或获取的图像所呈现的颜色是物体的展示颜色而不是色彩失真的颜色。与就是说,采用了上述拍照方法及装置之后,可自动对图像中存在的色彩失真进行分析并修正相应的色彩失真现象,提高了对图像进项白平衡处理的操作便利性,提高了白平衡处理的准确度和有效性。After adopting the above photographing method and device, the image displayed on the shooting preview interface is not the image directly captured by the camera, but the image after white balance processing on the image captured by the camera, and white balance is performed on the image captured by the camera. When processed, it is the ambient light obtained from the spectral sensor The difference between the spectrum and the standard white light spectrum determines the specific parameters and data of the processed white balance processing, so that the color displayed on the image displayed on the shooting preview interface and the image taken or captured is the color of the object. Not the color of the color distortion. That is to say, after adopting the above photographing method and device, the color distortion existing in the image can be automatically analyzed and the corresponding color distortion phenomenon is corrected, the operation convenience of the image white balance processing is improved, and the white balance processing is improved. Accuracy and effectiveness.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
其中:among them:
图1为一个实施例中一种拍照方法的流程示意图;1 is a schematic flow chart of a photographing method in an embodiment;
图2为一个实施例中一种拍照装置的结构示意图;2 is a schematic structural view of a photographing device in an embodiment;
图3为一个实施例中运行前述拍照方法的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device that runs the aforementioned photographing method in one embodiment.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为解决传统技术中的针对环境光线不是自然光谱的情况下的色彩失真的白平衡方法存在的白平衡效果的稳定性以及有效性不足的技术问题,在本实施例中,特提出了一种拍照方法,该方法的实现可依赖于计算机程序,该计算机程序可运行于基于冯诺依曼体系的计算机系统之上,该计算机程序可以是相机应用或者录像应用的应用程序。该计算机系统可以是运行上述计算机程序的例如智能手机、平板电脑、个人电脑等服务器或终端。In order to solve the technical problem of the stability of the white balance effect and the insufficient effectiveness of the white balance method for the color distortion in the case where the ambient light is not the natural spectrum in the conventional art, in the present embodiment, a photograph is specially proposed. Method, the implementation of the method may rely on a computer program that can run on a computer system based on the von Neumann system, which can be an application for a camera application or a video application. The computer system may be a server or terminal such as a smartphone, tablet, personal computer or the like that runs the above computer program.
需要说明的是,在本实施例中,上述控制闪光灯的方法所基于的终端中设 置有光谱传感器。具体的,光谱传感器可以检测环境光对应的光谱,即确定环境光光线在进行分光之后在各个波长或频率下的分布,或者,在进行分光之后在各个颜色下的分布。It should be noted that, in this embodiment, the terminal is based on the method for controlling the flash. A spectral sensor is placed. Specifically, the spectral sensor can detect the spectrum corresponding to the ambient light, that is, determine the distribution of the ambient light rays at various wavelengths or frequencies after performing the splitting, or the distribution under the respective colors after the splitting.
具体的,如图1所示,上述拍照方法包括如下步骤S102-S110:Specifically, as shown in FIG. 1 , the foregoing photographing method includes the following steps S102-S110:
步骤S102:在进入拍摄预览界面时,获取摄像头采集的原始图像。Step S102: Acquire an original image acquired by the camera when entering the shooting preview interface.
具体实施中,在用户进行拍照时,希望所拍摄的照片能呈现出被拍物体的真实情况,即被拍物体在拍照图像中所呈现的颜色是白平衡的,不存在色彩失真或者色差的问题。In a specific implementation, when the user takes a photo, it is hoped that the photograph taken can present the real situation of the object being photographed, that is, the color of the photographed object in the photographed image is white balance, and there is no problem of color distortion or chromatic aberration. .
在本实施例中,用户可以通过点击与相机对应的应用图标来开启相机应用并进入拍摄预览界面,在拍摄预览界面上展示的是通过摄像头采集的图像。需要说明的是,在本实施例中,在拍摄预览界面上展示的不是摄像头采集的原始图像,而是经过白平衡处理之后的图像。In this embodiment, the user can open the camera application by clicking the application icon corresponding to the camera and enter the shooting preview interface, and the image captured by the camera is displayed on the shooting preview interface. It should be noted that, in this embodiment, the original image captured by the camera is not displayed on the shooting preview interface, but the image after the white balance processing.
步骤S104:通过所述光谱传感器检测环境光光谱;Step S104: detecting an ambient light spectrum by the spectral sensor;
步骤S106:获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱。Step S106: Acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum.
如前所述,通过光谱传感器可以检测环境光对应的光谱,从而可知当前的环境光中是否存在除了自然光之外的其他光源,尤其是确定在环境光中存在的光源中是否包含了白平衡之外的彩色光源或者其他对白平衡有影响的光源。在终端中预存有标准的自然光下的自然光参考光谱,该自然光参考光谱对应的是白平衡状态下的标准白光光谱。As described above, the spectrum sensor can detect the spectrum corresponding to the ambient light, so that it is known whether there is any light source other than the natural light in the current ambient light, especially whether the white light balance is included in the light source existing in the ambient light. An external colored light source or other light source that affects the white balance. A natural light reference spectrum under standard natural light is prestored in the terminal, and the natural light reference spectrum corresponds to a standard white light spectrum in a white equilibrium state.
若环境光光谱与自然光参考光谱中存在差异,则说明当前在环境光中存在有影响白平衡的光源或者其他物品存在,也就是说,在当前环境下,用户肉眼所见的物品可能存在色彩失真的现象,或者,在当前的环境下拍摄的图像的色彩可能会与其真实的色彩之间存在色差。If there is a difference between the ambient light spectrum and the natural light reference spectrum, it indicates that there is currently a light source or other object that affects the white balance in the ambient light, that is, in the current environment, the object seen by the user's naked eye may have color distortion. The phenomenon, or the color of an image taken in the current environment may have a color difference from its true color.
上述色彩失真的程度或者色差的大小可以通过环境光光谱与自然光参考光谱之间的区别来确定。并且,因为本实施例是为了将环境光下的物品其原本的色彩进行呈现,因此需要确定应该在当前环境下添加怎样的管线才能使当前的环境下的光线呈现白平衡的状态。The degree of color distortion or the magnitude of the chromatic aberration described above can be determined by the difference between the ambient light spectrum and the natural light reference spectrum. Moreover, since the present embodiment is for presenting the original color of the article under ambient light, it is necessary to determine what kind of pipeline should be added under the current environment in order to make the light in the current environment appear white balance.
具体的,根据环境光光谱与自然光参考光谱之间的差值,可以确定在当前环境下为了达到白平衡应该对环境光进行的补偿的光线的具体参数,即确定对 环境光应当补偿的具体的补偿光谱。Specifically, according to the difference between the ambient light spectrum and the natural light reference spectrum, specific parameters of the light that should be compensated for the ambient light in order to achieve white balance in the current environment may be determined, that is, the pair is determined. The specific compensation spectrum that ambient light should compensate.
步骤S108:将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;Step S108: performing spectral superposition processing and/or spectral filtering processing on the original image on the compensation spectrum to obtain a preview image;
步骤S110:在拍摄预览界面上预设的第一图像预览区域展示预览图像。Step S110: displaying a preview image in a first image preview area preset on the shooting preview interface.
若环境光光谱与自然光参考光谱之间存在差值,即说明当前的环境光导致被拍摄物体所呈现出来的颜色存在色差,也就是说,若希望得到的是不存在色差的图像,则需要对摄像头获取的原始图像进行白平衡处理,经过白平衡处理之后的最终图像才是所需要的预览图像,例如,在拍摄预览界面上展示的预览界面。If there is a difference between the ambient light spectrum and the natural light reference spectrum, it means that the current ambient light causes the color difference exhibited by the object to be photographed, that is, if it is desired to obtain an image without chromatic aberration, it is necessary to The original image acquired by the camera is white balanced, and the final image after the white balance processing is the desired preview image, for example, a preview interface displayed on the shooting preview interface.
需要说明的是,在本实施例中,针对摄像头获取的原始图像进行的白平衡处理是根据补偿光谱来确定的,也就是说,根据自然光参考光谱与环境光光谱之间的差值,确定在原始图像上存在的色差的具体情况,然后再对其色差进行具体的处理。It should be noted that, in this embodiment, the white balance processing performed on the original image acquired by the camera is determined according to the compensation spectrum, that is, according to the difference between the natural light reference spectrum and the ambient light spectrum, The specific situation of the color difference existing on the original image, and then the color difference is specifically processed.
具体的,在本实施例中,根据补偿光谱在原始图像上进行光谱叠加,通过环境光光谱和补偿光谱的光谱叠加,即可得到在自然光参考光谱下的光谱,也就是说,最终经过光谱叠加之后的原始图像是白平衡的,也就是说,不存在色彩失真或者色差。Specifically, in the embodiment, the spectral superposition is performed on the original image according to the compensation spectrum, and the spectrum under the natural light reference spectrum can be obtained by spectral superposition of the ambient light spectrum and the compensation spectrum, that is, finally, the spectral superposition is performed. The original image afterwards is white balanced, that is, there is no color distortion or chromatic aberration.
进一步的,在另一个实施例中,上述对原始图像的处理,还可以是通过光谱滤除来进行。具体的,根据环境光光谱与自然光参考光谱之间的差值,确定在原始图像上除了自然光参考光谱之外的其他多余的数据,并且,将多余的光谱进行调整,最终得到的即为在自然光参考光谱下的图像。Further, in another embodiment, the processing of the original image may also be performed by spectral filtering. Specifically, according to the difference between the ambient light spectrum and the natural light reference spectrum, unnecessary data other than the natural light reference spectrum on the original image is determined, and the excess spectrum is adjusted, and finally the natural light is obtained. The image under the reference spectrum.
也就是说,通过环境光光谱和自然光参考光谱,确定在原始图像上需要达到白平衡所缺失的光谱数据或者需要达到白平衡所多余的光谱数据,然后将对应的光谱数据进行光谱叠加或者光谱滤除处理,从而使得经过处理之后的原始图像呈现出白平衡,即在处理得到的预览图像中呈现的颜色不存在色彩失真或色差。That is to say, through the ambient light spectrum and the natural light reference spectrum, it is determined that the spectral data missing from the white balance needs to be obtained on the original image or the spectral data that needs to reach the white balance, and then the corresponding spectral data is spectrally superimposed or spectrally filtered. In addition to the processing, the processed original image exhibits a white balance, that is, there is no color distortion or chromatic aberration in the color presented in the processed preview image.
在对原始图像进行处理并得到预览图像之后,即可在相应的拍摄预览界面进行展示。After processing the original image and getting a preview image, it can be displayed in the corresponding shooting preview interface.
进一步的,在本实施例中,在用户开启了相机应用之后,即可进行排着操作,针对在拍摄预览界面上展示的预览图像,若展示的预览图像是用户想要的 或者满足用户的需求的情况下,用户即可通过输入拍照指令获取该预览图像作为拍照图像并将拍照图像进行存储。Further, in this embodiment, after the user opens the camera application, the row operation can be performed, and if the preview image displayed on the shooting preview interface is displayed, the preview image displayed by the user is desired. Or if the user's needs are met, the user can obtain the preview image as a photographed image by inputting a photographing instruction and store the photographed image.
具体的,所述方法还包括:接收输入的拍照指令,根据所述拍照指令获取所述预览图像作为拍照图像并存储。Specifically, the method further includes: receiving an input photographing instruction, acquiring the preview image as a photographing image according to the photographing instruction, and storing the photographed image.
需要说明的是,在本实施例中,上述方法不仅限于拍照或单张图像的存储,还可适用于录像过程中图像帧的获取和展示。It should be noted that, in this embodiment, the foregoing method is not limited to the storage of a photograph or a single image, and is also applicable to the acquisition and display of an image frame during the recording process.
虽说经过上述白平衡处理过的图像所展示的颜色是展示的物体的真实颜色,但是,用户可能也会存在希望所拍物体呈现暖色调、冷色调或者其他要求,因此,用户在拍照时,还可以选择步骤S102中获取的原始图像。Although the color displayed by the image processed by the above white balance is the true color of the displayed object, the user may also have a desire to present a warm color, a cool color, or other requirements, so that when the user takes a photo, The original image acquired in step S102 can be selected.
可选的,在一个实施例中,上述在拍摄预览界面上展示预览图像还包括:在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像。Optionally, in an embodiment, the displaying the preview image on the shooting preview interface further includes: displaying the original image in a second image preview area preset on the shooting preview interface.
也就是说,在拍摄预览界面上既展示了没有经过白平衡处理的原始图像,也展示了经过白平衡处理的预览图像,以便用户对两个图像进行对比,例如,选择哪一个图像作为最终保存的图像。That is to say, on the shooting preview interface, both the original image without white balance processing and the preview image after white balance processing are displayed, so that the user can compare the two images, for example, which image is selected as the final save. Image.
具体的,在一个可选的实施例中,所述在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像之后还包括:获取用户输入的目标图像选择指令;根据所述目标图像选择指令获取与所述目标图像选择指令对应的预览图像或原始图像作为目标图像;将所述目标图像作为拍照图像并存储。Specifically, in an optional embodiment, after the displaying the original image in the second image preview area preset on the shooting preview interface, the method further includes: acquiring a target image selection instruction input by the user; The target image selection instruction acquires a preview image or an original image corresponding to the target image selection instruction as a target image; the target image is taken as a photographed image and stored.
也就是说,在拍摄预览界面上,用户可以针对展示的原始图像以及预览图像进行选择,例如,通过点击操作或者其他预设的操作来选择目标图像,在拍照或者录像的过程中,将用户选择的目标图像作为最终存储的图像。That is to say, on the shooting preview interface, the user can select the original image and the preview image to be displayed, for example, select a target image by a click operation or other preset operation, and select the user during the process of taking a photo or recording. The target image is used as the final stored image.
进一步的,在拍摄预览界面上还展示有白平衡开关组件,用户可以通过该白平衡开关组件来选择是否对摄像头获取的原始图像进行白平衡处理。Further, a white balance switch component is further displayed on the shooting preview interface, and the white balance switch component can be used by the user to select whether to perform white balance processing on the original image acquired by the camera.
在拍摄预览界面上还展示有微调组件,用户可以通过该微调组件来对具体的白平衡效果进行调整。A fine-tuning component is also displayed on the shooting preview interface, and the user can adjust the specific white balance effect through the fine-tuning component.
具体的,所述方法还包括:通过所述微调组件接收输入的白平衡调节指令,根据所述指令调节所述白平衡。Specifically, the method further includes receiving an input white balance adjustment instruction by the fine adjustment component, and adjusting the white balance according to the instruction.
例如,用户需要色调偏暖,而当前的展示效果是白平衡的,用户可以通过点击微调组件展示的微调控制页面来输入具体的调整要求,即在用户输入的白平衡调节指令中对应的调节数据,并且,根据用户输入的调节数据可以确定在 步骤S108中进行光谱滤除或者光谱叠加的过程中具体叠加的光谱数据或者具体滤除的光谱数据。For example, the user needs to have a warmer hue, and the current display effect is white balance. The user can input a specific adjustment request by clicking the fine-tuning control page displayed by the fine-tuning component, that is, the corresponding adjustment data in the white balance adjustment command input by the user. And, according to the adjustment data input by the user, it can be determined In step S108, spectral data specifically added in the process of spectral filtering or spectral superposition or specifically filtered spectral data is performed.
在进行拍照时,用户可能关心的只是拍摄的主体所对应的颜色的呈现,也就是说,对于其他部分的颜色用户并不关心,在进行白平衡处理的过程中,为了节省在白平衡过程中的计算量,可以只对图像中的部分区域进行处理,例如,可以仅对前景区域或者用户选择的区域进行处理。When taking a photo, the user may be concerned with the presentation of the color corresponding to the subject being photographed, that is to say, for other parts of the color user, in the process of white balance processing, in order to save the white balance process The amount of calculation can be processed only for a partial area in the image, for example, only the foreground area or the area selected by the user can be processed.
具体的,所述将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像的步骤还包括:获取所述原始图像的前景区域;将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理得到所述预览图像的前景区域;根据所述预览图像的前景区域和所述原始图像的非前景区域得到所述预览图像。Specifically, the step of performing spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image further includes: acquiring a foreground region of the original image; and corresponding to the compensation spectrum The foreground region of the original image is subjected to spectral superposition processing and/or spectral filtering processing to obtain a foreground region of the preview image; the preview image is obtained according to a foreground region of the preview image and a non-foreground region of the original image.
也就是说,在获取到原始图像之后,确定原始图像中对应的前景区域或者选中区域,并且在进行将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理的过程中,仅对前景区域或选中区域进行处理,在最终获取的预览图像中,与原始图像对应的前景区域或选中区域由经过光谱叠加处理和/或光谱滤除处理的原始图像决定,而其他区域则为原始图像中相应的区域。That is, after acquiring the original image, determining a corresponding foreground region or selected region in the original image, and performing spectral superposition processing and/or spectral filtering processing on the foreground region of the original image corresponding to the compensation spectrum. In the process, only the foreground area or the selected area is processed, and in the finally obtained preview image, the foreground area or the selected area corresponding to the original image is determined by the original image subjected to spectral superposition processing and/or spectral filtering processing, and other The area is the corresponding area in the original image.
此外,为解决传统技术中的针对环境光线不是自然光谱的情况下的色彩失真的白平衡方法存在的白平衡效果的稳定性以及有效性不足的技术问题,在一个实施例中,如图2所示,还提出了一种拍照装置,包括原始图像获取模块102、环境光光谱检测模块104、补偿光谱获取模块106、预览图像获取模块108以及预览图像展示模块110,其中:In addition, in order to solve the technical problem of the white balance effect of the white balance method for the color distortion in the case where the ambient light is not the natural spectrum in the conventional art, and the technical problem of insufficient effectiveness, in one embodiment, as shown in FIG. 2 The present invention also provides a photographing apparatus, including an original image acquisition module 102, an ambient light spectrum detection module 104, a compensation spectrum acquisition module 106, a preview image acquisition module 108, and a preview image display module 110, wherein:
所述装置基于设置有光谱传感器的终端;The device is based on a terminal provided with a spectral sensor;
所述装置包括:The device includes:
原始图像获取模块102,用于在进入拍摄预览界面时,获取摄像头采集的原始图像;The original image obtaining module 102 is configured to acquire an original image collected by the camera when entering the shooting preview interface;
环境光光谱检测模块104,用于通过所述光谱传感器检测环境光光谱;An ambient light spectrum detecting module 104, configured to detect an ambient light spectrum by the spectral sensor;
补偿光谱获取模块106,用于获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱; a compensation spectrum acquisition module 106, configured to acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
预览图像获取模块108,用于将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;a preview image obtaining module 108, configured to perform spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image;
预览图像展示模块110,用于在拍摄预览界面上预设的第一图像预览区域展示预览图像。The preview image display module 110 is configured to display a preview image in a first image preview area preset on the shooting preview interface.
可选的,在一个实施例中,如图2所述,上述装置还包括拍照图像获取模块112,用于接收输入的拍照指令,根据所述拍照指令获取所述预览图像作为拍照图像并存储。Optionally, in an embodiment, as shown in FIG. 2, the foregoing apparatus further includes a photographing image acquiring module 112, configured to receive an input photographing instruction, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
可选的,在一个实施例中,预览图像展示模块108还用于在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像。Optionally, in an embodiment, the preview image display module 108 is further configured to display the original image in a second image preview area preset on the shooting preview interface.
可选的,在一个实施例中,如图2所述,上述装置还包括目标图像选择模块114,用于获取用户输入的目标图像选择指令,根据所述目标图像选择指令获取与所述目标图像选择指令对应的预览图像或原始图像作为目标图像;将所述目标图像作为拍照图像并存储。Optionally, in an embodiment, as shown in FIG. 2, the foregoing apparatus further includes a target image selection module 114, configured to acquire a target image selection instruction input by a user, and acquire the target image according to the target image selection instruction. The preview image or the original image corresponding to the instruction is selected as the target image; the target image is taken as a photographed image and stored.
可选的,在一个实施例中,预览图像获取模块108还用于获取所述原始图像的前景区域;将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理得到所述预览图像的前景区域;根据所述预览图像的前景区域和所述原始图像的非前景区域得到所述预览图像。Optionally, in an embodiment, the preview image obtaining module 108 is further configured to acquire a foreground region of the original image, and perform spectral superposition processing and/or spectral filtering processing on a foreground region of the original image corresponding to the compensation spectrum. Obtaining a foreground area of the preview image; obtaining the preview image according to a foreground area of the preview image and a non-foreground area of the original image.
可选的,在一个实施例中,上述拍摄预览界面上设置有微调组件;如图2所述,上述装置还包括微调模块116,用于通过所述微调组件接收输入的白平衡调节指令,根据所述指令调节所述白平衡。Optionally, in an embodiment, the shooting preview interface is provided with a fine adjustment component; as shown in FIG. 2, the apparatus further includes a fine adjustment module 116, configured to receive an input white balance adjustment instruction by the fine adjustment component, according to The instructions adjust the white balance.
实施本发明实施例,将具有如下有益效果:Implementation of the embodiments of the present invention will have the following beneficial effects:
采用了上述拍照方法及装置之后,在拍摄预览界面上展示的图像,不是摄像头直接采集的图像,而是对摄像头采集的图像进行白平衡处理后的图像,并且,对摄像头采集的图像进行白平衡处理时,是根据光谱传感器获取的环境光光谱与标准的白光光谱之间的差值却确定处理的白平衡处理的具体参数和数据,从而使得在在拍摄预览界面上展示的图像以及拍照或获取的图像所呈现的颜色是物体的展示颜色而不是色彩失真的颜色。与就是说,采用了上述拍照方法及装置之后,可自动对图像中存在的色彩失真进行分析并修正相应的色彩失真现象,提高了对图像进项白平衡处理的操作便利性,提高了白平衡处理的准确度 和有效性。After adopting the above photographing method and device, the image displayed on the shooting preview interface is not the image directly captured by the camera, but the image after white balance processing on the image captured by the camera, and white balance is performed on the image captured by the camera. In the processing, the specific parameters and data of the processed white balance processing are determined according to the difference between the ambient light spectrum acquired by the spectral sensor and the standard white light spectrum, so that the image displayed on the shooting preview interface and the photographing or acquiring are obtained. The color that the image presents is the color of the object's display rather than the color distortion. That is to say, after adopting the above photographing method and device, the color distortion existing in the image can be automatically analyzed and the corresponding color distortion phenomenon is corrected, the operation convenience of the image white balance processing is improved, and the white balance processing is improved. Accuracy And effectiveness.
在一个实施例中,如图3所示,图3展示了一种运行上述拍照方法的基于冯诺依曼体系的计算机系统的终端。该计算机系统可以是智能手机、平板电脑、掌上电脑、笔记本电脑或个人电脑等设置有光谱传感器的终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。In one embodiment, as shown in FIG. 3, FIG. 3 illustrates a terminal of a von Neumann system-based computer system that operates the above-described photographing method. The computer system may be a terminal device equipped with a spectrum sensor such as a smartphone, a tablet, a palmtop, a laptop, or a personal computer. Specifically, an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included. The external input interface 1001 can optionally include at least a network interface 10012. The memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034. The output interface 1004 can include at least a device such as a display 10042.
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述基于冯诺依曼体系的计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的原始图像获取模块102、环境光光谱检测模块104、补偿光谱获取模块106、预览图像获取模块、108预览图像展示模块110、拍照图像获取模块112、目标图像选择模块114以及微调模块116。且在上述拍照方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。In this embodiment, the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned von Neumann system-based computer system, loaded into the internal memory 10034 at runtime, and then After being compiled into a machine code, it is passed to the processor 1002 for execution, so that the logical original image acquisition module 102, the ambient light spectrum detection module 104, the compensation spectrum acquisition module 106, and the preview are formed in the von Neumann system-based computer system. The image acquisition module, the preview image display module 110, the photographed image acquisition module 112, the target image selection module 114, and the fine adjustment module 116. During the execution of the above-mentioned photographing method, the input parameters are all received through the external input interface 1001, and transferred to the buffer in the memory 1003, and then input to the processor 1002 for processing, and the processed result data is cached in the memory 1003 for subsequent processing. The ground is processed or passed to the output interface 1004 for output.
具体的,上述处理器1002具体用与执行如下步骤:Specifically, the processor 1002 is specifically configured to perform the following steps:
在进入拍摄预览界面时,获取摄像头采集的原始图像;Obtain the original image captured by the camera when entering the shooting preview interface;
通过所述光谱传感器检测环境光光谱;Detecting an ambient light spectrum by the spectral sensor;
获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱;Obtaining a pre-stored natural light reference spectrum, and calculating a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;Performing spectral superposition processing and/or spectral filtering processing on the original image on the compensation spectrum to obtain a preview image;
在拍摄预览界面上预设的第一图像预览区域展示预览图像。The preview image is displayed on the first image preview area preset on the shooting preview interface.
可选的,在一个实施例中,上述处理器1002还用于执行接收输入的拍照指令,根据所述拍照指令获取所述预览图像作为拍照图像并存储。Optionally, in an embodiment, the processor 1002 is further configured to execute a photographing instruction for receiving an input, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
可选的,在一个实施例中,上述处理器1002还用于执行在所述拍摄预览界 面上预设的第二图像预览区域展示所述原始图像。Optionally, in an embodiment, the processor 1002 is further configured to execute in the shooting preview field. The second image preview area preset on the surface displays the original image.
可选的,在一个实施例中,上述处理器1002还用于执行获取用户输入的目标图像选择指令;根据所述目标图像选择指令获取与所述目标图像选择指令对应的预览图像或原始图像作为目标图像;将所述目标图像作为拍照图像并存储。Optionally, in an embodiment, the processor 1002 is further configured to: execute a target image selection instruction for acquiring a user input; and acquire, according to the target image selection instruction, a preview image or an original image corresponding to the target image selection instruction. a target image; the target image is taken as a photographed image and stored.
可选的,在一个实施例中,上述处理器1002还用于执行获取所述原始图像的前景区域;将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理得到所述预览图像的前景区域;根据所述预览图像的前景区域和所述原始图像的非前景区域得到所述预览图像。Optionally, in an embodiment, the processor 1002 is further configured to perform acquiring a foreground area of the original image, and performing spectral superposition processing and/or spectral filtering processing on a foreground area of the original image corresponding to the compensation spectrum. Obtaining a foreground area of the preview image; obtaining the preview image according to a foreground area of the preview image and a non-foreground area of the original image.
可选的,在一个实施例中,上述处理器1002还用于执行通过所述微调组件接收输入的白平衡调节指令,根据所述指令调节所述白平衡。Optionally, in an embodiment, the processor 1002 is further configured to execute a white balance adjustment instruction that receives an input through the fine adjustment component, and adjusts the white balance according to the instruction.
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。 The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and thus equivalent changes made in the claims of the present invention are still within the scope of the present invention.

Claims (12)

  1. 一种拍照方法,其特征在于,所述方法基于设置有光谱传感器的终端;A photographing method, characterized in that the method is based on a terminal provided with a spectral sensor;
    所述方法包括:The method includes:
    在进入拍摄预览界面时,获取摄像头采集的原始图像;Obtain the original image captured by the camera when entering the shooting preview interface;
    通过所述光谱传感器检测环境光光谱;Detecting an ambient light spectrum by the spectral sensor;
    获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱;Obtaining a pre-stored natural light reference spectrum, and calculating a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
    将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;Performing spectral superposition processing and/or spectral filtering processing on the original image on the compensation spectrum to obtain a preview image;
    在拍摄预览界面上预设的第一图像预览区域展示预览图像。The preview image is displayed on the first image preview area preset on the shooting preview interface.
  2. 根据权利要求1所述的拍照方法,其特征在于,所述方法还包括:The photographing method according to claim 1, wherein the method further comprises:
    接收输入的拍照指令,根据所述拍照指令获取所述预览图像作为拍照图像并存储。Receiving the input photographing instruction, acquiring the preview image as a photographing image according to the photographing instruction and storing.
  3. 根据权利要求1或2所述的拍照方法,其特征在于,所述在拍摄预览界面上展示预览图像还包括:The photographing method according to claim 1 or 2, wherein the displaying the preview image on the photographing preview interface further comprises:
    在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像。The original image is displayed on a second image preview area preset on the shooting preview interface.
  4. 根据权利要求3所述的拍照方法,其特征在于,所述在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像之后还包括:The photographing method according to claim 3, wherein the displaying the original image after the second image preview area preset on the shooting preview interface further comprises:
    获取用户输入的目标图像选择指令;Obtaining a target image selection instruction input by the user;
    根据所述目标图像选择指令获取与所述目标图像选择指令对应的预览图像或原始图像作为目标图像;Acquiring a preview image or an original image corresponding to the target image selection instruction as a target image according to the target image selection instruction;
    将所述目标图像作为拍照图像并存储。The target image is taken as a photographed image and stored.
  5. 根据权利要求1至4中任一项所述的拍照方法,其特征在于,所述将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像的步骤还包括: The photographing method according to any one of claims 1 to 4, wherein the step of performing spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image further comprises the step of: :
    获取所述原始图像的前景区域;Obtaining a foreground area of the original image;
    将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理得到所述预览图像的前景区域;Performing a spectral superposition process and/or a spectral filtering process on a foreground area of the original image corresponding to the compensation spectrum to obtain a foreground area of the preview image;
    根据所述预览图像的前景区域和所述原始图像的非前景区域得到所述预览图像。The preview image is obtained according to a foreground area of the preview image and a non-foreground area of the original image.
  6. 根据权利要求1至5中任一项所述的拍照方法,其特征在于,所述拍摄预览界面上设置有微调组件;The photographing method according to any one of claims 1 to 5, wherein the photographing preview interface is provided with a fine adjustment component;
    所述方法还包括:The method further includes:
    通过所述微调组件接收输入的白平衡调节指令,根据所述指令调节所述白平衡。An input white balance adjustment command is received by the fine adjustment component, and the white balance is adjusted according to the instruction.
  7. 一种拍照装置,其特征在于,所述装置基于设置有光谱传感器的终端;A photographing device, characterized in that the device is based on a terminal provided with a spectral sensor;
    所述装置包括:The device includes:
    原始图像获取模块,用于在进入拍摄预览界面时,获取摄像头采集的原始图像;An original image acquisition module, configured to acquire an original image acquired by the camera when entering the shooting preview interface;
    环境光光谱检测模块,用于通过所述光谱传感器检测环境光光谱;An ambient light spectrum detecting module for detecting an ambient light spectrum by the spectral sensor;
    补偿光谱获取模块,用于获取预存的自然光参考光谱,计算所述环境光光谱与所述自然光参考光谱的差值作为补偿光谱;a compensation spectrum acquisition module, configured to acquire a pre-stored natural light reference spectrum, and calculate a difference between the ambient light spectrum and the natural light reference spectrum as a compensation spectrum;
    预览图像获取模块,用于将所述补偿光谱对所述原始图像进行光谱叠加处理和/或光谱滤除处理得到预览图像;a preview image acquisition module, configured to perform spectral superposition processing and/or spectral filtering processing on the original image to obtain a preview image;
    预览图像展示模块,用于在拍摄预览界面上预设的第一图像预览区域展示预览图像。A preview image display module is configured to display a preview image in a first image preview area preset on the shooting preview interface.
  8. 根据权利要求7所述的拍照装置,其特征在于,所述装置还包括拍照图像获取模块,用于接收输入的拍照指令,根据所述拍照指令获取所述预览图像作为拍照图像并存储。The photographing apparatus according to claim 7, wherein the apparatus further comprises a photographing image acquiring module, configured to receive the input photographing instruction, and obtain the preview image as a photographing image according to the photographing instruction and store the image.
  9. 根据权利要求7或8所述的拍照装置,其特征在于,所述预览图像展示模块还用于在所述拍摄预览界面上预设的第二图像预览区域展示所述原始图像。 The photographing apparatus according to claim 7 or 8, wherein the preview image display module is further configured to display the original image in a second image preview area preset on the photographing preview interface.
  10. 根据权利要求9所述的拍照装置,其特征在于,所述装置还包括目标图像选择模块,用于获取用户输入的目标图像选择指令,根据所述目标图像选择指令获取与所述目标图像选择指令对应的预览图像或原始图像作为目标图像;将所述目标图像作为拍照图像并存储。The photographing apparatus according to claim 9, wherein the apparatus further comprises a target image selection module, configured to acquire a target image selection instruction input by the user, and acquire the target image selection instruction according to the target image selection instruction. A corresponding preview image or original image is used as the target image; the target image is taken as a photographed image and stored.
  11. 根据权利要求7至10中任一项所述的拍照装置,其特征在于,所述预览图像获取模块还用于获取所述原始图像的前景区域;将所述补偿光谱对应的原始图像的前景区域进行光谱叠加处理和/或光谱滤除处理得到所述预览图像的前景区域;根据所述预览图像的前景区域和所述原始图像的非前景区域得到所述预览图像。The photographing apparatus according to any one of claims 7 to 10, wherein the preview image acquisition module is further configured to acquire a foreground area of the original image; and a foreground area of the original image corresponding to the compensation spectrum Performing spectral superposition processing and/or spectral filtering processing to obtain a foreground region of the preview image; obtaining the preview image according to a foreground region of the preview image and a non-foreground region of the original image.
  12. 根据权利要求7至11中任一项所述的拍照装置,其特征在于,所述拍摄预览界面上设置有微调组件;所述装置还包括微调模块,用于通过所述微调组件接收输入的白平衡调节指令,根据所述指令调节所述白平衡。 The photographing apparatus according to any one of claims 7 to 11, wherein the photographing preview interface is provided with a fine adjustment component; the apparatus further comprises a fine adjustment module for receiving an input white through the fine adjustment component The balance adjustment command adjusts the white balance according to the command.
PCT/CN2017/072583 2016-09-29 2017-01-25 Photographing method and device WO2018058873A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610871676.7 2016-09-29
CN201610871676.7A CN106454081B (en) 2016-09-29 2016-09-29 Photographic method and device

Publications (1)

Publication Number Publication Date
WO2018058873A1 true WO2018058873A1 (en) 2018-04-05

Family

ID=58171656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/072583 WO2018058873A1 (en) 2016-09-29 2017-01-25 Photographing method and device

Country Status (2)

Country Link
CN (1) CN106454081B (en)
WO (1) WO2018058873A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333359A (en) * 2020-10-28 2021-02-05 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
WO2024051418A1 (en) * 2022-09-07 2024-03-14 北京与光科技有限公司 Photographing method based on spectral information, and electronic device

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609514B (en) * 2017-09-12 2021-08-06 Oppo广东移动通信有限公司 Face recognition method and related product
CN108495029B (en) 2018-03-15 2020-03-31 维沃移动通信有限公司 Photographing method and mobile terminal
CN108401120B (en) * 2018-04-28 2020-11-10 歌尔科技有限公司 Photographing method and device and wearable smart watch
CN110567106A (en) * 2018-06-05 2019-12-13 珠海格力电器股份有限公司 Room air quality display and control system and method
CN110891145B (en) * 2019-12-02 2021-08-17 联想(北京)有限公司 Method for obtaining image by photographing and electronic equipment
CN111953955B (en) * 2020-08-26 2022-01-04 维沃移动通信有限公司 White balance compensation method and device and electronic equipment
CN112529790B (en) * 2020-11-13 2023-06-27 清华大学 Image light intensity correction method and device for spectrum recovery
CN116156139A (en) * 2021-11-18 2023-05-23 北京与光科技有限公司 Image white balance optimization method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58151793A (en) * 1982-03-05 1983-09-09 Toshiba Corp Color tv camera device with automatic white balance
US4584598A (en) * 1982-06-10 1986-04-22 Sony Corporation Electronic camera
CN103731603A (en) * 2012-10-12 2014-04-16 三星电子株式会社 Apparatus and method for processing image in camera device and portable terminal
CN104113744A (en) * 2013-04-18 2014-10-22 深圳中兴力维技术有限公司 All-weather colour camera white balance processing method and device
CN105898260A (en) * 2016-04-07 2016-08-24 广东欧珀移动通信有限公司 Method and device of adjusting camera white balance

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763475B (en) * 2014-01-28 2017-11-17 宇龙计算机通信科技(深圳)有限公司 A kind of photographic method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58151793A (en) * 1982-03-05 1983-09-09 Toshiba Corp Color tv camera device with automatic white balance
US4584598A (en) * 1982-06-10 1986-04-22 Sony Corporation Electronic camera
CN103731603A (en) * 2012-10-12 2014-04-16 三星电子株式会社 Apparatus and method for processing image in camera device and portable terminal
CN104113744A (en) * 2013-04-18 2014-10-22 深圳中兴力维技术有限公司 All-weather colour camera white balance processing method and device
CN105898260A (en) * 2016-04-07 2016-08-24 广东欧珀移动通信有限公司 Method and device of adjusting camera white balance

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333359A (en) * 2020-10-28 2021-02-05 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
CN112333359B (en) * 2020-10-28 2022-09-16 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
WO2024051418A1 (en) * 2022-09-07 2024-03-14 北京与光科技有限公司 Photographing method based on spectral information, and electronic device

Also Published As

Publication number Publication date
CN106454081A (en) 2017-02-22
CN106454081B (en) 2019-03-22

Similar Documents

Publication Publication Date Title
WO2018058873A1 (en) Photographing method and device
EP3542347B1 (en) Fast fourier color constancy
US20150170389A1 (en) Automatic selection of optimum algorithms for high dynamic range image processing based on scene classification
US20070071316A1 (en) Image correcting method and image correcting system
JP6472869B2 (en) Image adjustment based on ambient light
US10244218B2 (en) Image processing apparatus, image processing system, image processing method, and non-transitory computer readable medium
US11711486B2 (en) Image capture method and systems to preserve apparent contrast of an image
JP5943845B2 (en) Image-to-image related object combination method
JPH10191246A (en) Image reproducing method for reproducing digital image data obtained by digital camera and digital camera used for the method
JP2006215756A (en) Image processing apparatus, image processing method, and program for the same
JP2007166456A (en) Image adjusting apparatus, image adjusting method and program
US20150213303A1 (en) Image processing with facial reference images
JP7412920B2 (en) Image processing device, image processing method and program
US20050270383A1 (en) Method for detecting and processing dominant color with automatic white balance
US20180055440A1 (en) Method and system for capturing images for wound assessment with self color compensation
US20170347080A1 (en) Lighting and material editing using flash photography
US20240022702A1 (en) Foldable electronic device for multi-view image capture
KR102260573B1 (en) Method and Apparatus for Color correction for multi-illuminant portraits on one scene
JP5598045B2 (en) Image processing apparatus, image processing program, imaging apparatus, and image display apparatus
Guarini et al. A practical procedure for obtaining calibrated material colors for CAD Systems
JP4857856B2 (en) Electronic camera having saturation adjustment function and image processing program
JP2006350621A (en) Image processor and image processing program
JP5810593B2 (en) Image processing apparatus, imaging apparatus, and program
WO2018000149A1 (en) Intelligent photographing system
Bokaris et al. One-frame delay for dynamic photometric compensation in a projector-camera system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17854334

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17854334

Country of ref document: EP

Kind code of ref document: A1