CN114414500B - Spectrum detection method, storage medium, electronic device, and apparatus - Google Patents
Spectrum detection method, storage medium, electronic device, and apparatus Download PDFInfo
- Publication number
- CN114414500B CN114414500B CN202210311268.1A CN202210311268A CN114414500B CN 114414500 B CN114414500 B CN 114414500B CN 202210311268 A CN202210311268 A CN 202210311268A CN 114414500 B CN114414500 B CN 114414500B
- Authority
- CN
- China
- Prior art keywords
- image
- light source
- reference light
- spectral
- imaging device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
- G01J3/2823—Imaging spectrometer
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Spectrometry And Color Measurement (AREA)
Abstract
本申请涉及一种光谱检测方法、存储介质、电子设备及装置。方法包括:通过成像装置,获得在参考光源处于开启状态下的第一图像以及在该参考光源处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值;根据该第一图像和该第二图像得到参考图像;和通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。其中,该转换模型基于该参考光源的出厂设定并经过预校准处理。其中,对该转换模型的预校准处理是基于该成像装置的模拟检测过程。如此有利于通过既有的硬件模组及功能来实现光谱检测。
The present application relates to a spectrum detection method, storage medium, electronic equipment and device. The method includes: obtaining, through an imaging device, a first image when the reference light source is on and a second image when the reference light source is off, wherein a difference between the shooting time of the first image and the shooting time of the second image The interval between the two is less than a preset threshold; a reference image is obtained according to the first image and the second image; and through the conversion model, the RGB intensity of each pixel on the reference image is converted into the corresponding spectral intensity, thereby obtaining the reference image. corresponding spectrogram. Wherein, the conversion model is based on the factory setting of the reference light source and undergoes pre-calibration processing. Wherein, the pre-calibration process of the conversion model is based on the simulation detection process of the imaging device. This facilitates spectral detection through existing hardware modules and functions.
Description
技术领域technical field
本申请涉及互联网技术领域,具体涉及智能终端技术领域,尤其涉及一种光谱检测方法、存储介质、电子设备及装置。The present application relates to the field of Internet technologies, in particular to the technical field of intelligent terminals, and in particular, to a spectral detection method, a storage medium, an electronic device, and a device.
背景技术Background technique
随着智能终端技术的发展以及半导体工业制造水平的进步,以手机、平板电脑等为代表的智能终端设备具备了越来越强的处理能力也配备了越来越强大的图像采集和处理功能例如采用了更好的相机等,这样的改进也使得智能终端设备如手机具备了更丰富的用途,包括超出传统意义上的利用手机进行通话和交流的用途。例如,智能手机和智能手环可具备生理参数测量的功能并用于例如健康监控等。With the development of smart terminal technology and the advancement of the manufacturing level of the semiconductor industry, smart terminal devices represented by mobile phones, tablet computers, etc. have more and more powerful processing capabilities and are also equipped with more and more powerful image acquisition and processing functions. For example The adoption of better cameras, etc., has also enabled smart terminal devices such as mobile phones to have richer uses, including uses beyond the traditional sense of using mobile phones to communicate and communicate. For example, smart phones and smart bracelets can be equipped with the function of physiological parameter measurement and used for health monitoring, for example.
光谱检测技术以及相应的光谱分析技术指的是通过检测物质的光谱来鉴别物质及确定化学组成等,并通过适当处理提供相关分析结论。光谱检测技术可以在不破坏样品前提下检测出物质成分,并且光谱分析结果在生物、医学、化学、食品安全、环境检测等多个领域有广泛用途。进行光谱检测的设备叫作光谱仪(Spectroscope),其原理是通过光探测器测量物体表面反射的光线并测定谱线不同波长位置强度从而测出物体成分。随着在光谱仪小型化方面的技术进展,光谱仪的设备尺寸大幅缩小,例如基于红外线光谱检测技术和数位光源处理技术(Digital Light Processing,DLP)的小型光谱仪的体积已经缩小到可放入衣物的口袋中。但是当前小型化的光谱仪设备仍然尺寸过大而不适合整合到手机里,并且小型化的光谱仪难以与手机的其他硬件模组一样通过半导体工艺而集成,也就是必须单独占用一部分手机内部有限的空间,因此并不利于在智能终端设备上推广光谱检测技术。另一方面,基于微纳工艺和光探测阵列的光谱仪或者说光谱芯片,虽然可通过半导体工艺制备,但是需要形成满足特殊要求的光学层结构才能提供必须的光线调制作用,例如CN112510059B公开了光调制结构的折射率必须控制在1至5之间等,因此也不利于在智能终端设备上推广光谱检测技术。Spectral detection technology and corresponding spectral analysis technology refer to identifying substances and determining chemical composition by detecting their spectra, and providing relevant analysis conclusions through appropriate processing. Spectral detection technology can detect material components without destroying the sample, and the results of spectral analysis are widely used in many fields such as biology, medicine, chemistry, food safety, and environmental testing. The equipment for spectral detection is called a spectrometer. With the technological progress in the miniaturization of spectrometers, the size of spectrometer equipment has been greatly reduced. For example, the volume of small spectrometers based on infrared spectral detection technology and digital light processing technology (Digital Light Processing, DLP) has been reduced to a pocket that can be put into clothing. middle. However, the current miniaturized spectrometer equipment is still too large to be integrated into the mobile phone, and the miniaturized spectrometer is difficult to integrate through the semiconductor process like other hardware modules of the mobile phone, that is, it must occupy a part of the limited space inside the mobile phone. , so it is not conducive to the promotion of spectral detection technology on intelligent terminal equipment. On the other hand, spectrometers or spectrometer chips based on micro-nano process and light detection array, although they can be prepared by semiconductor process, need to form an optical layer structure that meets special requirements in order to provide the necessary light modulation effect. For example, CN112510059B discloses a light modulation structure The refractive index must be controlled between 1 and 5, etc., so it is not conducive to the promotion of spectral detection technology on smart terminal equipment.
为此,需要一种光谱检测方法、存储介质、电子设备及装置,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,从而拓展这些智能终端设备的用途以覆盖基于光谱检测技术应用的生物、医学、化学、食品安全、环境检测等多个领域,有利于在智能终端设备上推广光谱检测技术。To this end, a spectral detection method, storage medium, electronic equipment and device are needed, which can make full use of the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers, thereby expanding the use of these smart terminal devices. In order to cover many fields such as biology, medicine, chemistry, food safety, and environmental detection based on the application of spectral detection technology, it is conducive to the promotion of spectral detection technology on intelligent terminal equipment.
发明内容SUMMARY OF THE INVENTION
第一方面,本申请实施例提供了一种光谱检测方法。所述光谱检测方法包括:通过成像装置,获得在参考光源处于开启状态下的第一图像以及在该参考光源处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值;根据该第一图像和该第二图像得到参考图像;和通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。其中,该转换模型基于该参考光源的出厂设定并经过预校准处理。其中,对该转换模型的预校准处理是基于该成像装置的模拟检测过程。In a first aspect, the embodiments of the present application provide a spectral detection method. The spectral detection method includes: obtaining, through an imaging device, a first image when a reference light source is on and a second image when the reference light source is off, wherein the shooting time of the first image and the second image are The interval between the shooting times is less than a preset threshold; a reference image is obtained according to the first image and the second image; and through the conversion model, the RGB intensity of each pixel on the reference image is converted into the corresponding spectral intensity, thereby obtaining Spectrogram corresponding to this reference image. Wherein, the conversion model is based on the factory setting of the reference light source and undergoes pre-calibration processing. Wherein, the pre-calibration process of the conversion model is based on the simulation detection process of the imaging device.
第一方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the first aspect can make use of the existing hardware modules and functions of the smart terminal device, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting sufficient A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,根据该第一图像和该第二图像得到该参考图像,包括:对该第一图像和该第二图像进行像素级相减运算得到该参考图像。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that obtaining the reference image according to the first image and the second image includes: the first image and the second image A pixel-level subtraction operation is performed to obtain the reference image.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,该成像装置的模拟检测过程包括将发射光谱已知的光源所发射的光被已知反射性质的参考物体反射后再由该成像装置接收。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the simulation detection process of the imaging device includes: the light emitted by a light source with a known emission spectrum is reflected by a reference object with a known reflection property After reflection, it is received by the imaging device.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,该参考光源的出厂设定包括该参考光源在出厂时测定的光谱分布。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the factory setting of the reference light source includes the spectral distribution measured at the factory of the reference light source.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,根据该第一图像和该第二图像得到该参考图像,包括:分别在该第一图像和该第二图像上识别感兴趣区域ROI,对该第一图像的ROI内的像素点和该第二图像的ROI内的像素点进行像素级相减运算得到该参考图像。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that obtaining the reference image according to the first image and the second image includes: obtaining the reference image in the first image and the second image respectively. A region of interest ROI is identified on the image, and pixel-level subtraction is performed on the pixel points in the ROI of the first image and the pixel points in the ROI of the second image to obtain the reference image.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,通过所述成像装置获得该第一图像的曝光时间可调整。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the exposure time for obtaining the first image by the imaging device can be adjusted.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,对该曝光时间的调整是基于所述成像装置的动态区间,并且该曝光时间的长度是基于相对于该参考光源的环境光的强度和/或所述成像装置获得该第一图像的拍摄距离。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the adjustment of the exposure time is based on the dynamic interval of the imaging device, and the length of the exposure time is based on the relative The first image is obtained with reference to the intensity of ambient light of the light source and/or the imaging device.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,对该曝光时间的调整还基于该预设阈值。According to a possible implementation manner of the technical solution of the first aspect, the embodiment of the present application further provides that the adjustment of the exposure time is also based on the preset threshold.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述参考光源所发射的光经过可调滤镜的过滤,所述可调滤镜被配置为根据相对于该参考光源的环境光中的RGB分量来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the light emitted by the reference light source is filtered by an adjustable filter, and the adjustable filter is configured to The RGB components in the light emitted by the reference light source are selectively enhanced or attenuated according to the RGB components in the ambient light of the reference light source.
根据第一方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述可调滤镜被配置为根据相对于该参考光源的环境光中的光谱分布来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量,包括:当该环境光中的光谱分布以蓝光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的R分量或者G分量并减弱所述参考光源所发射的光中的其它RGB分量;当该环境光中的光谱分布以黄光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的B分量并减弱所述参考光源所发射的光中的其它RGB分量。According to a possible implementation of the technical solution of the first aspect, the embodiment of the present application further provides that the tunable filter is configured to selectively enhance the spectral distribution of ambient light relative to the reference light source Or attenuate the RGB components in the light emitted by the reference light source, including: when the spectral distribution of the ambient light is dominated by blue light, the tunable filter is configured to enhance the light emitted by the reference light source. and attenuates other RGB components in the light emitted by the reference light source; when the spectral distribution of the ambient light is dominated by yellow light, the tunable filter is configured to enhance the reference The B component in the light emitted by the light source and attenuate the other RGB components in the light emitted by the reference light source.
第二方面,本申请实施例提供了一种移动设备。所述移动设备包括:图像采集装置;照明装置;和处理器。其中,所述处理器用于执行根据第一方面中任一项所述的光谱检测方法并且将该图像采集装置作为所述成像装置以及将该照明装置作为所述参考光源。In a second aspect, an embodiment of the present application provides a mobile device. The mobile device includes: an image capture device; an illumination device; and a processor. Wherein, the processor is configured to execute the spectral detection method according to any one of the first aspects and use the image acquisition device as the imaging device and the lighting device as the reference light source.
第二方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the second aspect can make use of the existing hardware modules and functions of the smart terminal equipment, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting enough A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
根据第二方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述移动设备是手机,所述图像采集装置是所述手机上的相机,所述照明装置是所述手机上的照明灯。According to a possible implementation of the technical solution of the second aspect, the embodiment of the present application further provides that the mobile device is a mobile phone, the image acquisition device is a camera on the mobile phone, and the lighting device is the Lights on your phone.
第三方面,本申请实施例提供了一种非瞬时性计算机可读存储介质。所述计算机可读存储介质存储有计算机指令,该计算机令被处理器执行时实现根据第一方面中任一项所述的光谱检测方法。In a third aspect, embodiments of the present application provide a non-transitory computer-readable storage medium. The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the spectral detection method according to any one of the first aspects.
第三方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the third aspect can make use of the existing hardware modules and functions of the smart terminal device, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting enough A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
第四方面,本申请实施例提供了一种电子设备。所述电子设备包括:处理器;用于存储处理器可执行指令的存储器。其中,所述处理器通过运行所述可执行指令以实现根据第一方面中任一项所述的光谱检测方法。In a fourth aspect, an embodiment of the present application provides an electronic device. The electronic device includes: a processor; and a memory for storing instructions executable by the processor. Wherein, the processor executes the executable instructions to implement the spectral detection method according to any one of the first aspects.
第四方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the fourth aspect can utilize the existing hardware modules and functions of the intelligent terminal equipment, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting enough A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
第五方面,本申请实施例提供了一种光谱检测装置。所述光谱检测装置包括:参考光源;成像装置,用于获得在该参考光源处于开启状态下的第一图像以及在该参考光源处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值;参考图像生成模块,用于根据该第一图像和该第二图像得到参考图像;转化模块,用于通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。其中,该转换模型基于该参考光源的出厂设定并经过预校准处理。其中,对该转换模型的预校准处理是基于该成像装置的模拟检测过程。In a fifth aspect, an embodiment of the present application provides a spectrum detection device. The spectral detection device includes: a reference light source; an imaging device for obtaining a first image when the reference light source is on and a second image when the reference light source is off, wherein the shooting time of the first image The interval between the shooting time of the second image and the second image is less than a preset threshold; the reference image generation module is used to obtain a reference image according to the first image and the second image; the conversion module is used to convert the model to the reference image. The RGB intensity of each pixel on the image is converted into the corresponding spectral intensity, thereby obtaining a spectral map corresponding to the reference image. Wherein, the conversion model is based on the factory setting of the reference light source and undergoes pre-calibration processing. Wherein, the pre-calibration process of the conversion model is based on the simulation detection process of the imaging device.
第五方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the fifth aspect can utilize the existing hardware modules and functions of the intelligent terminal equipment, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting sufficient A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
根据第五方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述成像装置获得该第一图像的曝光时间可调整,对该曝光时间的调整是基于所述成像装置的动态区间,并且该曝光时间的长度是基于相对于该参考光源的环境光的强度和/或所述成像装置获得该第一图像的拍摄距离。According to a possible implementation of the technical solution of the fifth aspect, the embodiment of the present application further provides that the exposure time for obtaining the first image by the imaging device can be adjusted, and the adjustment of the exposure time is based on the imaging device and the length of the exposure time is based on the intensity of ambient light relative to the reference light source and/or the shooting distance at which the imaging device obtains the first image.
根据第五方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述光谱检测装置还包括可调滤镜用于过滤所述参考光源所发射的光,所述可调滤镜被配置为根据相对于该参考光源的环境光中的RGB分量来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量。According to a possible implementation of the technical solution of the fifth aspect, the embodiment of the present application further provides that the spectral detection device further includes an adjustable filter for filtering the light emitted by the reference light source, the adjustable filter The filter is configured to selectively enhance or attenuate the RGB components of the light emitted by the reference light source according to the RGB components of the ambient light relative to the reference light source.
根据第五方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述可调滤镜被配置为根据相对于该参考光源的环境光中的RGB分量来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量,包括:当该环境光中的光谱分布以蓝光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的R分量或者G分量并减弱所述参考光源所发射的光中的其它RGB分量;当该环境光中的光谱分布以黄光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的B分量并减弱所述参考光源所发射的光中的其它RGB分量。According to a possible implementation of the technical solution of the fifth aspect, the embodiment of the present application further provides that the tunable filter is configured to selectively enhance the RGB components in the ambient light relative to the reference light source Or attenuate the RGB components in the light emitted by the reference light source, including: when the spectral distribution of the ambient light is dominated by blue light, the tunable filter is configured to enhance the light emitted by the reference light source. and attenuates other RGB components in the light emitted by the reference light source; when the spectral distribution of the ambient light is dominated by yellow light, the tunable filter is configured to enhance the reference The B component in the light emitted by the light source and attenuate the other RGB components in the light emitted by the reference light source.
第六方面,本申请实施例提供了一种手机,其特征在于,所述手机包括根据第五方面中任一项所述的光谱检测装置,并且所述成像装置是所述手机上的相机,所述参考光源是所述手机上的照明灯。In a sixth aspect, an embodiment of the present application provides a mobile phone, wherein the mobile phone includes the spectral detection device according to any one of the fifth aspects, and the imaging device is a camera on the mobile phone, The reference light source is an illumination lamp on the mobile phone.
第六方面所描述的技术方案,可以利用智能终端设备既有的硬件模组及功能因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。如此,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,有利于在智能终端设备上推广光谱检测技术。The technical solution described in the sixth aspect can utilize the existing hardware modules and functions of the smart terminal equipment, so it does not need to occupy space separately or to provide a specific optical layer structure and light modulation structure through a complex micro-nano process, and by setting sufficient A small preset threshold is used to limit the interval between the shooting time of the first image and the shooting time of the second image, so as to effectively exclude interference factors other than the reference light source, so that the conversion model based on the reference light source can be used. It realizes the accurate calculation of spectral detection results from the RGB intensity information contained in the reference image. In this way, the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, which is beneficial to the promotion of spectral detection technology on smart terminal devices.
根据第六方面的技术方案的一种可能的实现方式,本申请实施例还提供了,所述参考图像生成模块和所述转化模块通过所述手机上的处理装置实现,或者,所述参考图像生成模块和所述转化模块相对于该处理装置被单独提供并集成于所述光谱检测装置。According to a possible implementation of the technical solution of the sixth aspect, the embodiment of the present application further provides that the reference image generation module and the conversion module are implemented by a processing device on the mobile phone, or the reference image The generation module and the transformation module are provided separately from the processing device and are integrated into the spectral detection device.
附图说明Description of drawings
为了说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to describe the technical solutions in the embodiments of the present application or the background technology, the accompanying drawings required in the embodiments or the background technology of the present application will be described below.
图1示出了本申请实施例提供的光谱检测方法的流程示意图。FIG. 1 shows a schematic flowchart of a spectral detection method provided in an embodiment of the present application.
图2示出了本申请实施例提供的光谱检测装置的框图。FIG. 2 shows a block diagram of a spectral detection apparatus provided by an embodiment of the present application.
图3示出了本申请实施例提供的用于图1所示的光谱检测方法的电子设备的框图。FIG. 3 shows a block diagram of an electronic device used in the spectral detection method shown in FIG. 1 provided by an embodiment of the present application.
图4示出了本申请实施例提供的具备光谱检测功能的手机的框图。FIG. 4 shows a block diagram of a mobile phone with a spectrum detection function provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例为了解决在智能终端设备上推广光谱检测技术这样的技术难题,提出了一种光谱检测方法、存储介质、电子设备及装置。其中,所述光谱检测方法包括:通过成像装置,获得在参考光源处于开启状态下的第一图像以及在该参考光源处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值;根据该第一图像和该第二图像得到参考图像;和通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。其中,该转换模型基于该参考光源的出厂设定并经过预校准处理。其中,对该转换模型的预校准处理是基于该成像装置的模拟检测过程。本申请实施例具有以下有益技术效果:能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,从而拓展这些智能终端设备的用途以覆盖基于光谱检测技术应用的生物、医学、化学、食品安全、环境检测等多个领域,有利于在智能终端设备上推广光谱检测技术。In order to solve the technical problem of popularizing the spectral detection technology on the intelligent terminal equipment, the embodiments of the present application propose a spectral detection method, a storage medium, an electronic device and a device. Wherein, the spectrum detection method includes: obtaining a first image when the reference light source is turned on and a second image when the reference light source is turned off, through an imaging device, wherein the shooting time of the first image and the second image are obtained. The interval between the shooting times of the two images is less than a preset threshold; a reference image is obtained according to the first image and the second image; and the RGB intensity of each pixel on the reference image is converted into the corresponding spectral intensity through a conversion model, Thereby, a spectrogram corresponding to the reference image is obtained. Wherein, the conversion model is based on the factory setting of the reference light source and undergoes pre-calibration processing. Wherein, the pre-calibration process of the conversion model is based on the simulation detection process of the imaging device. The embodiments of the present application have the following beneficial technical effects: the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers can be fully utilized, thereby expanding the use of these smart terminal devices to cover applications based on spectrum detection technology. In many fields such as biology, medicine, chemistry, food safety, and environmental testing, it is beneficial to popularize spectral detection technology on intelligent terminal equipment.
本申请实施例可用于以下应用场景,包括但是不限于,光谱检测、光谱分析、生物成分检测、医学健康、食品安全、环境检测等。The embodiments of the present application can be used in the following application scenarios, including but not limited to, spectral detection, spectral analysis, biological component detection, medical health, food safety, environmental detection, and the like.
本申请实施例可以依据具体应用环境进行调整和改进,此处不做具体限定。The embodiments of the present application may be adjusted and improved according to a specific application environment, which is not specifically limited here.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请的实施例进行描述。In order to make those skilled in the art better understand the solutions of the present application, the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
图1示出了本申请实施例提供的光谱检测方法的流程示意图。如图1所示,该方法包括以下步骤。FIG. 1 shows a schematic flowchart of a spectral detection method provided in an embodiment of the present application. As shown in Figure 1, the method includes the following steps.
步骤S102:通过成像装置,获得在参考光源处于开启状态下的第一图像以及在该参考光源处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值。Step S102: Obtain a first image when the reference light source is on and a second image when the reference light source is off, using an imaging device, wherein the difference between the shooting time of the first image and the shooting time of the second image is obtained. The interval between them is less than the preset threshold.
步骤S104:根据该第一图像和该第二图像得到参考图像。Step S104: Obtain a reference image according to the first image and the second image.
步骤S106:通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图;其中,该转换模型基于该参考光源的出厂设定并经过预校准处理;对该转换模型的预校准处理是基于该成像装置的模拟检测过程。Step S106: Convert the RGB intensity of each pixel on the reference image into corresponding spectral intensity through the conversion model, thereby obtaining a spectrogram corresponding to the reference image; wherein, the conversion model is based on the factory setting of the reference light source and passed through Pre-calibration process; the pre-calibration process of the conversion model is based on the simulation detection process of the imaging device.
请参阅上述步骤S102至步骤S106,在步骤S102,通过要求该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值,以及通过设定足够小的预设阈值,可以使得第一图像和第二图像之间的差距几乎都来自于是否有参考光源的照明。这样就使得接下来在步骤S104中通过根据该第一图像和该第二图像得到参考图像,该参考图像等效于仅在参考光源的照明条件下所获得的图像。在一些实施例中,可以通过安排相对比较稳定的拍摄环境来降低对预设阈值的要求,也就是降低对该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔的要求。例如,当图1所示的光谱检测方法用于食品安全的场景,可以将需要测定成分的食品样品放置在室内且具备稳定的室内照明条件,例如关上窗帘只用室内照明设备等,这样做有利于保持拍摄第一图像的时刻和拍摄第二图像的时刻,除了参考光源是处于开启状态或者关闭状态以外,其他的因素是基本一致的,这样就能通过在步骤S104进行的相应运算例如进行像素级相减运算或者其他运算来抵消这些保持不变的因素而只保留参考光源的影响。但是,在另一些实施例中,可能难以提供相对比较稳定的拍摄环境,例如用于人体医疗健康检测的场景如医院里或者用于环境检测的场景如污水处理场所等,这些场景下要求足够小的该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,也就是对该成像装置的拍摄速度或者说快门速度有一定要求。这一点,可以结合具体采用的成像装置的性能来设定,例如该成像装置可能是专业的高速摄像机并能提供两千分之一秒的快门拍摄速度或者说每一秒能最多拍摄两千张图像。一般情况下,所述光谱检测方法主要应用于智能终端设备例如智能手机,而智能手机上也一般配备了性能较好的相机并提供快速拍摄模式等,例如日常拍摄下手机上的相机可以做到1/125至1/500的快门拍摄速度,也就是每秒可以拍摄125张到500张图像。这样的快门速度足以捕捉到日常拍摄情况下的移动中的行人、自行车等。综上所述,取决于具体的拍摄条件下除了参考光源以外的干扰因素,包括环境光、背景光、反射光等其他光源,可以设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,从而克服这些干扰因素的影响,进而使得所获得的第一图像和第二图像之间的差距几乎都来自于是否有参考光源的照明这一因素。Please refer to the above steps S102 to S106. In step S102, by requiring the interval between the shooting time of the first image and the shooting time of the second image to be less than a preset threshold, and by setting a sufficiently small preset threshold, It is possible to make the difference between the first image and the second image almost all come from whether there is illumination of the reference light source. This makes it possible to obtain a reference image according to the first image and the second image in step S104, and the reference image is equivalent to an image obtained only under the illumination condition of the reference light source. In some embodiments, a relatively stable shooting environment can be arranged to reduce the requirement on the preset threshold, that is, reduce the requirement on the interval between the shooting time of the first image and the shooting time of the second image. For example, when the spectral detection method shown in Figure 1 is used in a food safety scenario, the food samples whose components need to be determined can be placed indoors with stable indoor lighting conditions, such as closing the curtains and using only indoor lighting equipment. It is beneficial to maintain the moment when the first image is taken and the moment when the second image is taken. Except whether the reference light source is in an on state or off state, other factors are basically the same, so that the corresponding operation in step S104 can be performed. Stage subtraction or other operations can be used to cancel these constant factors and retain only the influence of the reference light source. However, in other embodiments, it may be difficult to provide a relatively stable shooting environment, for example, a scene used for human medical health detection, such as a hospital, or a scene used for environmental detection, such as a sewage treatment site, etc., the requirements for these scenes are sufficiently small The interval between the shooting time of the first image and the shooting time of the second image, that is, the shooting speed or shutter speed of the imaging device has certain requirements. This point can be set in combination with the performance of the imaging device used. For example, the imaging device may be a professional high-speed camera and can provide a shutter speed of one thousandth of a second, or a maximum of two thousand images per second. . In general, the spectral detection method is mainly applied to smart terminal devices such as smart phones, and smart phones are generally equipped with cameras with better performance and provide fast shooting modes. Shutter shooting speed of 1/125 to 1/500, that is, 125 to 500 images per second can be captured. This shutter speed is sufficient to capture moving pedestrians, bicycles, etc. in everyday shooting situations. To sum up, depending on the interference factors other than the reference light source under specific shooting conditions, including ambient light, background light, reflected light and other light sources, a small enough preset threshold can be set to limit the shooting of the first image The interval between the time and the shooting time of the second image, so as to overcome the influence of these interference factors, so that the difference between the obtained first image and the second image almost all comes from whether there is illumination of the reference light source. factor.
在步骤S104,根据该第一图像和该第二图像得到参考图像。上面提到,第一图像对应参考光源处于开启状态下,而第二图像对应参考光源处于关闭状态下,除了参考光源的状态变化之外,通过设定足够小的预设阈值例如结合具体的拍摄条件和干扰因素,可以等效于认为第一图像代表了RF+A,这里R代表了图像上像素点的RGB强度的函数或者说RGB强度的分布,F代表参考光源,A代表除了参考光源以外的能影响RGB强度的因素(这些因素被视为相对于参考光源的干扰因素)。则第二图像代表了RA,这里假设第二张图像中的A也就是干扰因素与第一张图像中的A相同或者基本一致。因此,通过对该第一图像和该第二图像进行适当运算例如像素级相减运算,也就是相当于进行了RF+A减去RA的运算,如此得到的参考图像,其代表了RF,也就是说参考图像上只保留了F也就是参考光源的因素。In step S104, a reference image is obtained according to the first image and the second image. As mentioned above, the first image corresponds to the reference light source in an on state, and the second image corresponds to the reference light source in an off state, in addition to the state change of the reference light source, by setting a sufficiently small preset threshold, for example, in combination with specific shooting Conditions and interference factors can be equivalent to thinking that the first image represents R F+A , where R represents the function of the RGB intensity of pixels on the image or the distribution of RGB intensity, F represents the reference light source, and A represents the reference light source except for the reference light source. Factors other than those that can affect RGB intensity (these are considered disturbances relative to the reference light source). Then the second image represents R A , and it is assumed here that A in the second image, that is, the interference factor, is the same as or substantially consistent with A in the first image. Therefore, by performing appropriate operations on the first image and the second image, such as pixel-level subtraction, which is equivalent to performing an operation of R F+A minus R A , the reference image thus obtained represents R F , that is to say, only the factor of F, which is the reference light source, is retained on the reference image.
在步骤S106,通过转换模型,将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。上面提到,参考图像代表了RF,也就是仅受到参考光源影响的像素点的RGB强度。转换模型可以表示为T,而光谱强度分布可以表示为R(λ)。通过计算RF x T = R(λ),可以实现根据参考图像的像素点的RGB强度以及转换模型T,来得到参考图像上像素点的相应光谱强度。如此得到的光谱图就是光谱检测结果,可以进一步用来进行分析处理来测定物质成分,适用于基于光谱检测技术应用的生物、医学、化学、食品安全、环境检测等多个领域。In step S106, by converting the model, the RGB intensity of each pixel on the reference image is converted into corresponding spectral intensity, thereby obtaining a spectral map corresponding to the reference image. As mentioned above, the reference image represents the RF , which is the RGB intensity of the pixels only affected by the reference light source. The transformation model can be denoted as T, while the spectral intensity distribution can be denoted as R(λ). By calculating R F x T = R (λ), it is possible to obtain the corresponding spectral intensities of the pixels on the reference image according to the RGB intensity of the pixels of the reference image and the conversion model T. The spectrum obtained in this way is the spectrum detection result, which can be further used for analysis and processing to determine the substance composition, and is suitable for many fields such as biology, medicine, chemistry, food safety, and environmental detection based on the application of spectrum detection technology.
上述的光谱检测方法,能够提供良好的光谱检测结果的关键在于转换模型T,也就是说转换模型T必须能足够精确地实现从参考图像的像素点的RGB强度到相应光谱强度的转换。而可能干扰转换模型T的精确性也就是可能干扰上述光谱检测方法的表现的因素,正是来自于除了参考光源以外的其他光源。这是因为参考光源以外的其他光源往往不可控并且带有很高的随机性,例如自然光、环境光等,这样就使得无法建立起足够准确的转换模型来将这些可能的干扰因素都考虑进去。如上所述,通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔,然后进行运算从而有效地排除除了参考光源以外的干扰因素。另外,该转换模型T基于该参考光源的出厂设定并经过预校准处理;对该转换模型T的预校准处理是基于该成像装置的模拟检测过程。这里,该参考光源的出厂设定可以被认为代表了该参考光源在出厂时的转换模型T,也就是说借助该参考光源的出厂设定可以完成上述的计算从而实现根据参考图像的像素点的RGB强度以及转换模型T来得到参考图像上像素点的相应光谱强度。考虑到参考光源在出厂之后的使用过程中,可能面临器件老化、损耗等各种情况,从而偏离了出厂时的设定,因此需要通过预校准处理来测定当前的参考光源的转换模型。另外,即使参考光源保持了出厂设定,也可能存在其他器件的老化或损耗从而使得参考光源对外表现出来的情况与出厂设定有所偏离。为此,通过该成像装置的模拟检测过程,也就是以当前的成像装置和当前的参考光源模拟进行一次光谱检测并将检测结果与参考结果比较,然后进行适当处理就可以完成对该转换模型T的预校准。The key to the above-mentioned spectral detection method being able to provide good spectral detection results lies in the conversion model T, that is to say, the conversion model T must be able to achieve the conversion from the RGB intensity of the pixel point of the reference image to the corresponding spectral intensity accurately enough. And the factors that may interfere with the accuracy of the conversion model T, that is, the factors that may interfere with the performance of the above-mentioned spectral detection method, come from other light sources other than the reference light source. This is because other light sources other than the reference light source are often uncontrollable and have high randomness, such as natural light, ambient light, etc., which makes it impossible to establish an accurate enough conversion model to take these possible interference factors into account. As described above, the interval between the shooting time of the first image and the shooting time of the second image is defined by setting a sufficiently small preset threshold, and then the calculation is performed to effectively eliminate interference factors other than the reference light source. In addition, the conversion model T is based on the factory setting of the reference light source and undergoes a pre-calibration process; the pre-calibration process of the conversion model T is based on a simulated detection process of the imaging device. Here, the factory setting of the reference light source can be considered to represent the conversion model T of the reference light source when it leaves the factory, that is to say, the above-mentioned calculation can be completed with the help of the factory setting of the reference light source, so as to realize the transformation according to the pixels of the reference image. RGB intensities and transformation model T to obtain the corresponding spectral intensities of pixels on the reference image. Considering that the reference light source may face various conditions such as device aging and loss during the use process after leaving the factory, which deviates from the factory setting, it is necessary to determine the conversion model of the current reference light source through pre-calibration processing. In addition, even if the reference light source maintains the factory settings, there may be aging or wear of other components that may cause the external appearance of the reference light source to deviate from the factory settings. To this end, through the simulation detection process of the imaging device, that is, performing a spectral detection by simulating the current imaging device and the current reference light source, comparing the detection result with the reference result, and then performing appropriate processing, the conversion model T can be completed. pre-calibration.
可以看出,上述的光谱检测方法,可以利用智能终端设备既有的硬件模组及功能例如利用手机上的照明设备作为参考光源以及利用手机上的相机作为成像装置,因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔(例如设定为拍摄运动中行人的快门拍摄速度),然后进行运算从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。上述的光谱检测方法,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,从而拓展这些智能终端设备的用途以覆盖基于光谱检测技术应用的生物、医学、化学、食品安全、环境检测等多个领域,有利于在智能终端设备上推广光谱检测技术。It can be seen that the above-mentioned spectral detection method can use the existing hardware modules and functions of the intelligent terminal equipment, such as using the lighting equipment on the mobile phone as a reference light source and using the camera on the mobile phone as an imaging device, so it does not need to occupy space separately or not. A specific optical layer structure and a light modulation structure are provided through a complex micro-nano process, and the interval between the shooting time of the first image and the shooting time of the second image is defined by setting a sufficiently small preset threshold (for example, set It is determined as the shutter speed of shooting pedestrians in motion), and then the calculation is carried out to effectively eliminate the interference factors other than the reference light source, so that the conversion model of the reference light source can be used to accurately convert the RGB intensity contained in the reference image from the reference image. The information extrapolates the spectral detection results. The above-mentioned spectral detection method can make full use of the existing highly integrated hardware modules and functions of smart terminal devices such as mobile phones and tablet computers, thereby expanding the use of these smart terminal devices to cover biological, medical, Chemistry, food safety, environmental detection and other fields are conducive to the promotion of spectral detection technology on intelligent terminal equipment.
在一种可能的实施方式中,根据该第一图像和该第二图像得到该参考图像。包括:对该第一图像和该第二图像进行像素级相减运算得到该参考图像。应当理解的是,其他合适的像素级运算或者其他运算方式也可以采用,只要能有效地排除除了参考光源以外的干扰因素。In a possible implementation manner, the reference image is obtained according to the first image and the second image. The method includes: performing a pixel-level subtraction operation on the first image and the second image to obtain the reference image. It should be understood that other suitable pixel-level operations or other operation manners can also be used, as long as interference factors other than the reference light source can be effectively excluded.
在一种可能的实施方式中,该成像装置的模拟检测过程包括将发射光谱已知的光源所发射的光被已知反射性质的参考物体反射后再由该成像装置接收。在一些实施例中,该参考物体是白色测试板。如上所述,通过该成像装置的模拟检测过程,也就是以当前的成像装置和当前的参考光源模拟进行一次光谱检测并将检测结果与参考结果比较,然后进行适当处理就可以完成对该转换模型T的预校准。这里,通过例如白色测试板的参考物体,其自身的反射性质是可以预先判断的也因此可以推定经过该参考物体反射后的光谱检测结果也就是参考结果,例如可以根据参考物体的已知的衰减特性和入射光的光谱强度分布来推算反射光的光谱强度分布。一般来说,反射性质均一的或者具有相对简单的反射性质的参考物体如单色测试板等,其反射性质已知或者容易推定。如此通过上述的模拟检测过程就可以完成对该转换模型T的预校准。应当理解的是,除了白色测试板,还可以采用其他已知反射性质的参考物体,只要其光谱检测结果能便利地预先推定。还可以考虑用不同颜色的测试板拼装在一起或者其他图案或样式的测试板。In a possible implementation, the analog detection process of the imaging device includes reflecting light emitted by a light source with a known emission spectrum by a reference object with a known reflection property before being received by the imaging device. In some embodiments, the reference object is a white test panel. As mentioned above, through the simulation detection process of the imaging device, that is, the current imaging device and the current reference light source are simulated to perform a spectral detection and compare the detection result with the reference result, and then perform appropriate processing to complete the conversion model. Pre-calibration of T. Here, through a reference object such as a white test plate, its own reflection properties can be pre-judged, so it can be estimated that the spectral detection result after the reflection of the reference object is the reference result, for example, it can be based on the known attenuation of the reference object. characteristics and the spectral intensity distribution of incident light to estimate the spectral intensity distribution of reflected light. Generally speaking, for a reference object with uniform or relatively simple reflection properties, such as a monochromatic test plate, the reflection properties are known or easily inferred. In this way, the pre-calibration of the conversion model T can be completed through the above-mentioned simulation detection process. It should be understood that, in addition to the white test plate, other reference objects of known reflective properties may be used, as long as their spectral detection results can be conveniently pre-estimated. Also consider using different colored test panels assembled together or other patterns or styles of test panels.
在一种可能的实施方式中,该参考光源的出厂设定包括该参考光源在出厂时测定的光谱分布。如此,通过在出厂时测定参考光源的光谱分布,可以更好地推定参考光源的转换模型。In a possible embodiment, the factory setting of the reference light source includes the spectral distribution of the reference light source determined at the factory. In this way, by measuring the spectral distribution of the reference light source at the time of shipment, the conversion model of the reference light source can be better estimated.
在一种可能的实施方式中,根据该第一图像和该第二图像得到该参考图像,包括:分别在该第一图像和该第二图像上识别感兴趣区域ROI,对该第一图像的ROI内的像素点和该第二图像的ROI内的像素点进行像素级相减运算得到该参考图像。考虑到实际应用中需要进行光谱分析检测的样品可能仅占据图像上一部分区域,例如用于食品安全的场景下待检测的食品样品位于图像中央的一部分区域,因此可以通过ROI来集中资源分析处理ROI内的光谱信息,这样可以更好地利用智能终端设备上有限的计算资源和降低能耗。In a possible implementation manner, obtaining the reference image according to the first image and the second image includes: identifying a region of interest (ROI) on the first image and the second image, respectively; The reference image is obtained by performing pixel-level subtraction between the pixels in the ROI and the pixels in the ROI of the second image. Considering that the samples that need to be subjected to spectral analysis and detection in practical applications may only occupy a part of the area on the image, for example, the food sample to be detected in a food safety scenario is located in a part of the center of the image, so the ROI can be used to concentrate resources to analyze and process the ROI. In this way, the limited computing resources on smart terminal devices can be better utilized and energy consumption can be reduced.
在一种可能的实施方式中,通过所述成像装置获得该第一图像的曝光时间可调整。在一些实施例中,对该曝光时间的调整是基于所述成像装置的动态区间,并且该曝光时间的长度是基于相对于该参考光源的环境光的强度和/或所述成像装置获得该第一图像的拍摄距离。在一些实施例中,对该曝光时间的调整还基于该预设阈值。上面提到,第一图像对应参考光源处于开启状态下,通过调整曝光时间可以充分利用成像装置如相机的动态区间,如果曝光时间太长则导致动态区间过于饱和,如果曝光时间太短则可能导致信号太弱从而导致信噪比过高。通过调整第一图像的曝光时间,特别是根据动态区间来调整曝光时间,可以提高信噪比,这样有助于克服背景光太强烈或者参考光源相对于背景光来说太弱的情况下带来的较强烈的噪声干扰。另外,结合实际适用的需要,可以基于相对于该参考光源的环境光的强度和/或所述成像装置获得该第一图像的拍摄距离,来更灵活地调整曝光时间的长度。例如,在工业检测的场景如污水检测,一般需要对大面积的远距离的污水进行光谱分析检测,这种情况下所述成像装置获得该第一图像的拍摄距离较远,则适合调整曝光时间以提高信噪比。再例如,在室内可能面临背景光太强烈的情况例如室内照明的亮度太高,这种情况下相对于该参考光源的环境光的强度过高,则适合调整曝光时间以克服太强烈的背景光的干扰。再例如,在背景光不那么强烈且拍摄距离也较近的情况下,则可以调整曝光时间来充分利用动态区间,取得更好的检测效果。另外,曝光时间的调整还可以基于该预设阈值,上面提到预设阈值的作用是用来限定拍摄第一图像的时刻和拍摄第二图像的时刻之间的间隔从而抑制干扰因素的影响,因此可以结合预设阈值来调整曝光时间进一步地抑制干扰和提高信噪比。In a possible implementation, the exposure time for obtaining the first image by the imaging device is adjustable. In some embodiments, the adjustment of the exposure time is based on the dynamic interval of the imaging device, and the length of the exposure time is based on the intensity of ambient light relative to the reference light source and/or the imaging device obtains the first The shooting distance of an image. In some embodiments, the adjustment to the exposure time is also based on the preset threshold. As mentioned above, when the reference light source corresponding to the first image is turned on, the dynamic range of the imaging device such as a camera can be fully utilized by adjusting the exposure time. If the exposure time is too long, the dynamic range will be too saturated. If the exposure time is too short, it may cause The signal is too weak and the signal-to-noise ratio is too high. By adjusting the exposure time of the first image, especially adjusting the exposure time according to the dynamic range, the signal-to-noise ratio can be improved, which helps to overcome the problems caused by the background light being too strong or the reference light source being too weak relative to the background light. Strong noise interference. In addition, in combination with practical requirements, the length of the exposure time can be adjusted more flexibly based on the intensity of ambient light relative to the reference light source and/or the shooting distance at which the imaging device obtains the first image. For example, in industrial inspection scenarios such as sewage inspection, it is generally necessary to perform spectral analysis and inspection on a large area of long-distance sewage. In this case, the imaging device obtains the first image with a long shooting distance, so it is suitable to adjust the exposure time. to improve the signal-to-noise ratio. For another example, indoors may face a situation where the background light is too strong, for example, the brightness of the indoor lighting is too high. In this case, the intensity of the ambient light relative to the reference light source is too high, so it is suitable to adjust the exposure time to overcome the effect of the too strong background light. interference. For another example, when the background light is not so strong and the shooting distance is relatively short, the exposure time can be adjusted to make full use of the dynamic range to achieve better detection results. In addition, the adjustment of the exposure time can also be based on the preset threshold. The function of the preset threshold mentioned above is to limit the interval between the moment when the first image is taken and the moment when the second image is taken, so as to suppress the influence of interference factors, Therefore, the exposure time can be adjusted in combination with the preset threshold to further suppress interference and improve the signal-to-noise ratio.
在一种可能的实施方式中,所述参考光源所发射的光经过可调滤镜的过滤,所述可调滤镜被配置为根据相对于该参考光源的环境光中的RGB分量来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量。这里,可调滤镜的过滤会改变参考光源所发射的光的光谱分布,例如绿色滤镜的过滤会得到以绿光为主的光谱分布。相对于该参考光源的环境光中的RGB分量,是上述提到的需要抑制的会给光谱检测效果带来负面影响的干扰因素。因此,可以根据相对于该参考光源的环境光中的RGB分量来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量,从而抑制环境光带来的影响同时增强参考光源的影响,这样就能提高信噪比和改进检测效果。在一些实施例中,所述可调滤镜被配置为根据相对于该参考光源的环境光中的光谱分布来选择性地增强或者减弱所述参考光源所发射的光中的RGB分量,包括:当该环境光中的光谱分布以蓝光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的R分量或者G分量并减弱所述参考光源所发射的光中的其它RGB分量;当该环境光中的光谱分布以黄光为主时,所述可调滤镜被配置为增强所述参考光源所发射的光中的B分量并减弱所述参考光源所发射的光中的其它RGB分量。因此,当环境光中的RGB分量以蓝光为主时,这种情况可以是在工厂车间或者实验室等使用蓝光灯或者蓝光为主的照明设备的场景,这时候通过增强参考光源的R分量或者G分量同时减弱其他分量,则可以提高信噪比。当环境光中的RGB分量以黄光为主时,这种情况常见于半导体加工制造行业,其中的超净间等场所一般用黄光为主的照明设备,这时候通过增强参考光源的B分量同时减弱其他分量,则可以提高信噪比。In one possible implementation, the light emitted by the reference light source is filtered by a tunable filter, the tunable filter being configured to selectively select according to RGB components in ambient light relative to the reference light source The RGB components in the light emitted by the reference light source are substantially enhanced or attenuated. Here, the filtering of the tunable filter will change the spectral distribution of the light emitted by the reference light source, for example, the filtering of the green filter will obtain a spectral distribution dominated by green light. Relative to the RGB components in the ambient light of the reference light source, it is the aforementioned interference factor that needs to be suppressed and will negatively affect the spectral detection effect. Therefore, the RGB components in the light emitted by the reference light source can be selectively enhanced or weakened according to the RGB components in the ambient light relative to the reference light source, thereby suppressing the influence of the ambient light and enhancing the influence of the reference light source , which can improve the signal-to-noise ratio and improve the detection effect. In some embodiments, the tunable filter is configured to selectively enhance or attenuate RGB components in light emitted by the reference light source according to a spectral distribution in ambient light relative to the reference light source, including: When the spectral distribution in the ambient light is dominated by blue light, the tunable filter is configured to enhance the R component or the G component in the light emitted by the reference light source and attenuate the light emitted by the reference light source. and other RGB components of other RGB components in the light. Therefore, when the RGB component in the ambient light is dominated by blue light, this situation can be the scene of using blue light or blue light-dominated lighting equipment in the factory workshop or laboratory. At this time, by enhancing the R component of the reference light source or The G component attenuates other components at the same time, and the signal-to-noise ratio can be improved. When the RGB component in the ambient light is dominated by yellow light, this situation is common in the semiconductor processing and manufacturing industry, where the ultra-clean room and other places generally use yellow light-based lighting equipment. At this time, by enhancing the B component of the reference light source At the same time, attenuating other components can improve the signal-to-noise ratio.
应当理解的是,上述方法可以通过相应的执行主体或者载体来实现。在一些示例性实施例中,一种非瞬时性计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,该计算机指令被处理器执行时实现上述方法以及上述任意实施例、实施方式或者它们的组合。在一些示例性实施例中,一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现上述方法以及上述任意实施例、实施方式或者它们的组合。It should be understood that, the above method can be implemented by a corresponding executive body or carrier. In some exemplary embodiments, a non-transitory computer-readable storage medium stores computer instructions that, when executed by a processor, implement the foregoing method and any of the foregoing embodiments and implementations or a combination of them. In some exemplary embodiments, an electronic device includes: a processor; a memory for storing processor-executable instructions; wherein the processor executes the executable instructions to implement the above method and any of the above implementations examples, implementations, or a combination thereof.
另外,上述方法可以通过移动设备或者任意合适的智能终端设备来实现。例如,一种移动设备包括:图像采集装置;照明装置;和处理器。其中,所述处理器用于执行上述光谱检测方法并且将该图像采集装置作为所述成像装置以及将该照明装置作为所述参考光源。该移动设备可以是手机、平板电脑或者任意合适的设备或智能终端设备,只要具备必需的元件如成像装置和参考光源。图像采集装置可以是该移动设备上任意合适的设备,例如手机上可能有多个具有拍摄功能的摄像头或相机,其中任意一个摄像头或相机都可以作为所述成像装置。照明装置可以是该移动设备上自带的例如手机自带的背面照明灯,也可以是附加的或者另外提供的例如配套的照明装置,只要能满足上述光谱检测方法的有关细节。In addition, the above method can be implemented by a mobile device or any suitable intelligent terminal device. For example, a mobile device includes: an image capture device; an illumination device; and a processor. Wherein, the processor is configured to execute the above-mentioned spectral detection method and use the image acquisition device as the imaging device and the lighting device as the reference light source. The mobile device can be a mobile phone, a tablet computer, or any suitable device or smart terminal device, as long as it has necessary components such as an imaging device and a reference light source. The image acquisition device may be any suitable device on the mobile device, for example, there may be multiple cameras or cameras with a shooting function on the mobile phone, any one of the cameras or cameras can be used as the imaging device. The lighting device may be a built-in back light of the mobile device, such as a mobile phone, or an additional or additionally provided lighting device, such as a matching lighting device, as long as the relevant details of the above-mentioned spectral detection method are met.
图2示出了本申请实施例提供的光谱检测装置的框图。如图2所示,所述光谱检测装置包括:参考光源210;成像装置220,用于获得在该参考光源210处于开启状态下的第一图像以及在该参考光源210处于关闭状态下的第二图像,其中该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔小于预设阈值;参考图像生成模块230,用于根据该第一图像和该第二图像得到参考图像;转化模块240,用于通过转换模型(未示出),将该参考图像上各个像素点的RGB强度转换为相应光谱强度,从而得到与该参考图像对应的光谱图。其中,该转换模型基于该参考光源210的出厂设定并经过预校准处理。其中,对该转换模型的预校准处理是基于该成像装置220的模拟检测过程。应当理解的是,该光谱检测装置可以理解为智能终端设备的一部分,以集成于该智能终端设备或者附加的方式,还可以理解为以软件如指令或程序或应用的方式来调用该智能终端设备的已有硬件模组来实现相应的功能,在此不做具体限定。并且,参考光源210与成像装置220之间通信地连接从而使得成像装置220可以获得第一图像和第二图像并且与参考光源210一起完成模拟检测过程。成像装置220所获得的图像被传输给参考图像生成模块230,然后再由参考图像生成模块230传输给转化模块240。转化模块240还与参考光源210连接用于实现基于该参考光源210的出厂设定和预校准处理来确定转化模型。FIG. 2 shows a block diagram of a spectral detection apparatus provided by an embodiment of the present application. As shown in FIG. 2, the spectral detection device includes: a reference light source 210; an
上述的光谱检测装置,可以利用智能终端设备既有的硬件模组及功能例如利用手机上的照明设备作为参考光源210以及利用手机上的相机作为成像装置220,因此无需单独占用空间也无需通过复杂的微纳工艺来提供特定光学层结构和光调制结构,而且通过设定足够小的预设阈值来限定该第一图像的拍摄时间和该第二图像的拍摄时间之间的间隔(例如设定为拍摄运动中行人的快门拍摄速度),然后进行运算从而有效地排除除了参考光源以外的干扰因素,进而使得可以基于该参考光源的转换模型来实现精确地从参考图像所包含的RGB强度的信息推算出光谱检测结果。上述的光谱检测装置,能够充分利用手机、平板电脑等智能终端设备既有的高度集成化的硬件模组及功能,从而拓展这些智能终端设备的用途以覆盖基于光谱检测技术应用的生物、医学、化学、食品安全、环境检测等多个领域,有利于在智能终端设备上推广光谱检测技术。The above-mentioned spectral detection device can use the existing hardware modules and functions of the intelligent terminal equipment, such as using the lighting device on the mobile phone as the reference light source 210 and using the camera on the mobile phone as the
在一种可能的实施方式中,所述成像装置220获得该第一图像的曝光时间可调整,对该曝光时间的调整是基于所述成像装置220的动态区间,并且该曝光时间的长度是基于相对于该参考光源210的环境光的强度和/或所述成像装置220获得该第一图像的拍摄距离。如此,可以提高信噪比,这样有助于克服背景光太强烈或者参考光源相对于背景光来说太弱的情况下带来的较强烈的噪声干扰。In a possible implementation manner, the exposure time during which the
在一种可能的实施方式中,所述光谱检测装置还包括可调滤镜(未示出)用于过滤所述参考光源210所发射的光,所述可调滤镜被配置为根据相对于该参考光源210的环境光中的RGB分量来选择性地增强或者减弱所述参考光源210所发射的光中的RGB分量。如此,可以抑制环境光带来的影响同时增强参考光源210的影响,这样就能提高信噪比和改进检测效果。In a possible implementation, the spectral detection device further includes an adjustable filter (not shown) for filtering the light emitted by the reference light source 210, the adjustable filter is configured to The RGB components in the ambient light of the reference light source 210 are used to selectively enhance or weaken the RGB components in the light emitted by the reference light source 210 . In this way, the influence of ambient light can be suppressed while the influence of the reference light source 210 can be enhanced, so that the signal-to-noise ratio can be improved and the detection effect can be improved.
在一种可能的实施方式中,所述可调滤镜被配置为根据相对于该参考光源210的环境光中的RGB分量来选择性地增强或者减弱所述参考光源210所发射的光中的RGB分量,包括:当该环境光中的光谱分布以蓝光为主时,所述可调滤镜被配置为增强所述参考光源210所发射的光中的R分量或者G分量并减弱所述参考光源210所发射的光中的其它RGB分量;当该环境光中的光谱分布以黄光为主时,所述可调滤镜被配置为增强所述参考光源210所发射的光中的B分量并减弱所述参考光源210所发射的光中的其它RGB分量。如此,可以抑制环境光带来的影响同时增强参考光源210的影响,这样就能提高信噪比和改进检测效果。In a possible implementation, the tunable filter is configured to selectively enhance or weaken the light emitted by the reference light source 210 according to the RGB components in the ambient light relative to the reference light source 210 RGB components, including: when the spectral distribution in the ambient light is dominated by blue light, the tunable filter is configured to enhance the R component or the G component in the light emitted by the reference light source 210 and attenuate the reference other RGB components in the light emitted by the light source 210; when the spectral distribution in this ambient light is dominated by yellow light, the tunable filter is configured to enhance the B component in the light emitted by the reference light source 210 And attenuate other RGB components in the light emitted by the reference light source 210 . In this way, the influence of ambient light can be suppressed while the influence of the reference light source 210 can be enhanced, so that the signal-to-noise ratio can be improved and the detection effect can be improved.
图3示出了本申请实施例提供的用于图1所示的光谱检测方法的电子设备的框图。如图3所示,电子设备包括主处理器302,内部总线304,网络接口306,主存储器308,以及辅助处理器310和辅助内存312,还有辅助处理器320和辅助内存322。其中,主处理器302与主存储器308连接,主存储器308可用于存储主处理器302可执行的计算机指令,从而可以实现图1所示的光谱检测方法,包括其中部分或者全部步骤,也包括其中步骤的任意可能的组合或结合以及可能的替换或者变体。网络接口306用于提供网络连接以及通过网络收发数据。内部总线304用于提供在主处理器302、网络接口306、辅助处理器310以及辅助处理器320之间的内部的数据交互。其中,辅助处理器310与辅助内存312连接并一起提供辅助计算能力,而辅助处理器320与辅助内存322连接并一起提供辅助计算能力。辅助处理器310和辅助处理器320可以提供相同或者不同的辅助计算能力,包括但是不限于,针对特定计算需求进行优化的计算能力如并行处理能力或者张量计算能力,针对特定算法或者逻辑结构进行优化的计算能力例如迭代计算能力或者图计算能力等。辅助处理器310和辅助处理器320可以包括特定类型的一个或者多个处理器,如数字信号处理器(DSP),专用集成电路(ASIC),现场可编程门阵列(FPGA)等,从而可以提供定制化的功能和结构。在一些示例性实施例中,电子设备可以不包括辅助处理器,可以包括仅一个辅助处理器,还可以包括任意数量的辅助处理器且各自具有相应的定制化功能及结构,在此不做具体限定。图3中所示出的两个辅助处理器的架构仅为说明性而不应解释为限制性。另外,主处理器302可以包括单核或者多核的计算单元,用于提供本申请实施例所必需的功能和操作。另外,主处理器302和辅助处理器(如图3中的辅助处理器310和辅助处理器320)可以具有不同的架构,也就是电子设备可以是基于异构架构的系统,例如主处理器302可以是基于指令集操作体系的通用型处理器如CPU,而辅助处理器可以是适合并行化计算的图形处理器GPU或者是适合神经网络模型相关运算的专用加速器。辅助内存(例如图3所示的辅助内存312和辅助内存322)可以用于配合各自对应的辅助处理器来实现定制化功能及结构。而主存储器308用于存储必要的指令、软件、配置、数据等从而可以配合主处理器302提供本申请实施例所必需的功能和操作。在一些示例性实施例中,电子设备可以不包括辅助内存,可以包括仅一个辅助内存,还可以包括任意数量的辅助内存,在此不做具体限定。图3中所示出的两个辅助内存的架构仅为说明性而不应解释为限制性。主存储器308以及可能的辅助内存可以包括以下一个或多个特征:易失性,非易失性,动态,静态,可读/写,只读,随机访问,顺序访问,位置可寻址性,文件可寻址性和内容可寻址性,并且可以包括随机存取存储器(RAM),闪存,只读存储器(ROM),可擦可编程只读存储器(EPROM),电可擦可编程只读存储器(EEPROM),寄存器,硬盘,可移动磁盘,可记录和/或可重写光盘(CD),数字多功能光盘(DVD),大容量存储介质设备或任何其他形式的合适存储介质。内部总线304可以包括不同总线结构中的任何一种或不同总线结构的组合,例如存储器总线或存储器控制器,外围总线,通用串行总线和/或利用多种总线体系结构中的任何一种的处理器或本地总线。应当理解的是,图3所示的电子设备,其所示的结构并不构成对有关装置或系统的具体限定,在一些示例性实施例中,电子设备可以包括比具体实施例和附图更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者具有不同的部件布置。FIG. 3 shows a block diagram of an electronic device used in the spectral detection method shown in FIG. 1 provided by an embodiment of the present application. As shown in FIG. 3 , the electronic device includes a
图4示出了本申请实施例提供的具备光谱检测功能的手机的框图。如图4所示,该手机包括照明灯410、相机420、处理装置430以及存储器440。图4所示的手机可以包括上述的光谱检测装置,并且所述成像装置220是所述手机上的相机420,所述参考光源210是所述手机上的照明灯410。其中,参考图像生成模块230和转化模块240通过所述手机上的处理装置430实现,或者,所述参考图像生成模块230和所述转化模块240相对于该处理装置430被单独提供并集成于所述光谱检测装置。FIG. 4 shows a block diagram of a mobile phone with a spectrum detection function provided by an embodiment of the present application. As shown in FIG. 4 , the mobile phone includes a light 410 , a camera 420 , a
应当理解的是,手机上的处理装置430可以通过运行存储在存储器440中的程序或指令的方式来操作照明灯410和相机420从而完成上述的光谱检测方法,也就是参考图像生成模块230和转化模块240通过所述手机上的处理装置430实现。在另一些实施例中,可以单独提供所述参考图像生成模块230和所述转化模块240,例如通过可拔插的配件方式来单独提供这些模块的功能,如提供一个集成化的光谱检测装置,其作为一个整体可以通过如USB接口来连接手机并提供拓展的光谱检测功能。It should be understood that the
本申请提供的具体实施例可以用硬件,软件,固件或固态逻辑电路中的任何一种或组合来实现,并且可以结合信号处理,控制和/或专用电路来实现。本申请具体实施例提供的设备或装置可以包括一个或多个处理器(例如,微处理器,控制器,数字信号处理器(DSP),专用集成电路(ASIC),现场可编程门阵列(FPGA)等),这些处理器处理各种计算机可执行指令从而控制设备或装置的操作。本申请具体实施例提供的设备或装置可以包括将各个组件耦合在一起的系统总线或数据传输系统。系统总线可以包括不同总线结构中的任何一种或不同总线结构的组合,例如存储器总线或存储器控制器,外围总线,通用串行总线和/或利用多种总线体系结构中的任何一种的处理器或本地总线。本申请具体实施例提供的设备或装置可以是单独提供,也可以是系统的一部分,也可以是其它设备或装置的一部分。The specific embodiments provided herein may be implemented in any one or combination of hardware, software, firmware or solid state logic circuits, and may be implemented in conjunction with signal processing, control and/or special purpose circuits. The apparatus or apparatus provided by the specific embodiments of the present application may include one or more processors (eg, a microprocessor, a controller, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) ), etc.), these processors process various computer-executable instructions to control the operation of a device or apparatus. The device or apparatus provided by the specific embodiments of the present application may include a system bus or a data transmission system that couples various components together. A system bus may include any one or a combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and/or processing utilizing any of a variety of bus architectures device or local bus. The equipment or apparatus provided by the specific embodiments of the present application may be provided independently, may be a part of a system, or may be a part of other equipment or apparatus.
本申请提供的具体实施例可以包括计算机可读存储介质或与计算机可读存储介质相结合,例如能够提供非暂时性数据存储的一个或多个存储设备。计算机可读存储介质/存储设备可以被配置为保存数据,程序器和/或指令,这些数据,程序器和/或指令在由本申请具体实施例提供的设备或装置的处理器执行时使这些设备或装置实现有关操作。计算机可读存储介质/存储设备可以包括以下一个或多个特征:易失性,非易失性,动态,静态,可读/写,只读,随机访问,顺序访问,位置可寻址性,文件可寻址性和内容可寻址性。在一个或多个示例性实施例中,计算机可读存储介质/存储设备可以被集成到本申请具体实施例提供的设备或装置中或属于公共系统。计算机可读存储介质/存储设备可以包括光存储设备,半导体存储设备和/或磁存储设备等等,也可以包括随机存取存储器(RAM),闪存,只读存储器(ROM),可擦可编程只读存储器(EPROM),电可擦可编程只读存储器(EEPROM),寄存器,硬盘,可移动磁盘,可记录和/或可重写光盘(CD),数字多功能光盘(DVD),大容量存储介质设备或任何其他形式的合适存储介质。Embodiments provided herein may include or be combined with computer-readable storage media, such as one or more storage devices capable of providing non-transitory data storage. The computer-readable storage medium/storage device may be configured to hold data, programmers and/or instructions that, when executed by the processors of the apparatuses or apparatuses provided by the specific embodiments of the present application, cause these apparatuses Or the device realizes the relevant operation. Computer-readable storage media/storage devices may include one or more of the following characteristics: volatile, non-volatile, dynamic, static, read/write, read-only, random access, sequential access, location addressability, File addressability and content addressability. In one or more exemplary embodiments, the computer-readable storage medium/storage device may be integrated into the device or apparatus provided by the specific embodiments of the present application or belong to a public system. Computer readable storage media/storage devices may include optical storage devices, semiconductor storage devices and/or magnetic storage devices, etc., and may also include random access memory (RAM), flash memory, read only memory (ROM), erasable and programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Registers, Hard Disk, Removable Disk, Recordable and/or Rewritable Compact Disc (CD), Digital Versatile Disc (DVD), Mass storage media device or any other form of suitable storage media.
以上是本申请实施例的实施方式,应当指出,本申请具体实施例描述的方法中的步骤可以根据实际需要进行顺序调整、合并和删减。在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。可以理解的是,本申请实施例以及附图所示的结构并不构成对有关装置或系统的具体限定。在本申请另一些实施例中,有关装置或系统可以包括比具体实施例和附图更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者具有不同的部件布置。本领域技术人员将理解,在不脱离本申请具体实施例的精神和范围的情况下,可以对具体实施例记载的方法和设备的布置,操作和细节进行各种修改或变化;在不脱离本申请实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本申请的保护范围。The above are the implementations of the embodiments of the present application. It should be noted that the steps in the methods described in the specific embodiments of the present application may be adjusted, combined and deleted in order according to actual needs. In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments. It can be understood that the structures shown in the embodiments of the present application and the accompanying drawings do not constitute a specific limitation on the relevant device or system. In other embodiments of the present application, the related device or system may include more or less components than the specific embodiments and drawings, or combine some components, or separate some components, or have different component arrangements. Those skilled in the art will understand that, without departing from the spirit and scope of the specific embodiments of the present application, various modifications or changes can be made to the arrangements, operations and details of the methods and devices described in the specific embodiments; Under the premise of applying the principle of the embodiment, several improvements and modifications can also be made, and these improvements and modifications are also regarded as the protection scope of the present application.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210311268.1A CN114414500B (en) | 2022-03-28 | 2022-03-28 | Spectrum detection method, storage medium, electronic device, and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210311268.1A CN114414500B (en) | 2022-03-28 | 2022-03-28 | Spectrum detection method, storage medium, electronic device, and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114414500A CN114414500A (en) | 2022-04-29 |
CN114414500B true CN114414500B (en) | 2022-08-02 |
Family
ID=81263393
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210311268.1A Expired - Fee Related CN114414500B (en) | 2022-03-28 | 2022-03-28 | Spectrum detection method, storage medium, electronic device, and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114414500B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116625938A (en) * | 2023-03-23 | 2023-08-22 | 深圳市格灵精睿视觉有限公司 | General optical device, detection method and electronic equipment, storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9787815B2 (en) * | 2013-01-21 | 2017-10-10 | Cornell University | Smartphone-based apparatus and method |
EP3477271A1 (en) * | 2017-10-26 | 2019-05-01 | Yara International ASA | Handheld device using a light guide and method for use thereof for determining a plant status |
EP3591385A1 (en) * | 2018-07-06 | 2020-01-08 | Roche Diabetes Care GmbH | A detection method for detecting an analyte in a sample |
AR119035A1 (en) * | 2019-05-29 | 2021-11-17 | Yara Int Asa | METHOD TO ESTIMATE THE CHLOROPHYLL CONTENT OF A LEAF |
CN111464700A (en) * | 2020-04-07 | 2020-07-28 | 吉林求是光谱数据科技有限公司 | Novel smart phone with imaging spectrum detection function and spectrum detection method thereof |
-
2022
- 2022-03-28 CN CN202210311268.1A patent/CN114414500B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN114414500A (en) | 2022-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7356490B2 (en) | Methods for detecting analytes in samples | |
US11835515B2 (en) | Method for evaluating suitability of lighting conditions for detecting an analyte in a sample using a camera of a mobile device | |
US20230146924A1 (en) | Neural network analysis of lfa test strips | |
Yang et al. | Effect of smart phone cameras on color-based prediction of soil organic matter content | |
CN112985589B (en) | Ambient illuminance detection and correction coefficient calculation method and device and electronic equipment | |
Thakur et al. | Smartphone-based, automated detection of urine albumin using deep learning approach | |
CN111750994B (en) | A Spectral Measurement Method Based on Digital Camera Imaging Model | |
CN114414500B (en) | Spectrum detection method, storage medium, electronic device, and apparatus | |
CN105891112A (en) | Vegetable leaf freshness detection device and method based on Android mobile phone | |
CN114424046B (en) | Inspection method, recording medium, and inspection system | |
Bao et al. | A remote computing based point-of-care colorimetric detection system with a smartphone under complex ambient light conditions | |
CN113639881A (en) | Color temperature testing method and device, computer readable medium and electronic equipment | |
CN115100400A (en) | Lens film color measurement method, system, computer equipment and storage medium | |
CN112611723B (en) | HSV/HSB color space colorimetric method, system and storage medium for measuring concentration of monochrome solution | |
JP7438403B2 (en) | Apparatus, methods of calibrating the apparatus, and devices for calibrating the apparatus | |
CN114216573A (en) | Color temperature detection method and device, computer readable medium, electronic device | |
WO2022247656A1 (en) | Spectral measurement method and apparatus | |
CN113865709A (en) | Intelligent lamp color testing device and method based on prism color separation | |
US9870515B2 (en) | Identification system and method | |
JP2002039859A (en) | Method and instrument for determining quantitatively contrast of brightness, and computor-readable recording medium | |
RU2791099C2 (en) | Method for determining analyte in a sample | |
CN117579947A (en) | Response value determination method, device, electronic equipment and storage medium | |
Hyttinen | Optical implementation of partially negative filters using a spe | |
CN120031979A (en) | A method, system, device and storage medium for improving the brightness consistency of infrared camera module images | |
CN115824982A (en) | An optical POCT color interpretation method, system and device |
Legal Events
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220802 |
|
CF01 | Termination of patent right due to non-payment of annual fee |