CN114414500B - Spectrum detection method, storage medium, electronic device, and apparatus - Google Patents

Spectrum detection method, storage medium, electronic device, and apparatus Download PDF

Info

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
imaging device
spectral
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210311268.1A
Other languages
Chinese (zh)
Other versions
CN114414500A (en
Inventor
周勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Maidu Technology Co ltd
Original Assignee
Shenzhen Maidu Technology Co ltd
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 Shenzhen Maidu Technology Co ltd filed Critical Shenzhen Maidu Technology Co ltd
Priority to CN202210311268.1A priority Critical patent/CN114414500B/en
Publication of CN114414500A publication Critical patent/CN114414500A/en
Application granted granted Critical
Publication of CN114414500B publication Critical patent/CN114414500B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J3/00Spectrometry; Spectrophotometry; Monochromators; Measuring colours
    • G01J3/28Investigating the spectrum
    • G01J3/2823Imaging spectrometer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The present application relates to a spectrum detection method, a storage medium, an electronic device, and an apparatus. The method comprises the following steps: obtaining a first image when a reference light source is in an on state and a second image when the reference light source is in an off state by an imaging device, wherein the interval between the shooting time of the first image and the shooting time of the second image is less than a preset threshold value; obtaining a reference image according to the first image and the second image; and converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a 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 is subjected to pre-calibration processing. Wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device. This is advantageous for achieving spectral detection through existing hardware modules and functions.

Description

Spectrum detection method, storage medium, electronic device, and apparatus
Technical Field
The application relates to the technical field of internet, in particular to the technical field of intelligent terminals, and particularly relates to a spectrum detection method, a storage medium, electronic equipment and a device.
Background
With the development of the intelligent terminal technology and the progress of the semiconductor industry manufacturing level, intelligent terminal devices represented by mobile phones, tablet computers and the like have stronger and stronger processing capability and are also provided with stronger and stronger image acquisition and processing functions, for example, better cameras and the like are adopted, and the improvement also enables the intelligent terminal devices such as the mobile phones to have richer uses, including uses beyond the traditional use of the mobile phones for conversation and communication. For example, smartphones and smartbands may be equipped with physiological parameter measurement functionality and used for e.g. health monitoring.
Spectroscopic detection techniques and corresponding spectroscopic analysis techniques refer to the identification of substances and the determination of chemical compositions etc. by detecting the spectrum of a substance and providing relevant analytical conclusions by appropriate processing. The spectrum detection technology can detect the substance components without destroying the sample, and the spectrum analysis result has wide application in a plurality of fields of biology, medicine, chemistry, food safety, environmental detection and the like. The device for performing spectral measurements is called a spectrometer (Spectroscope) and its principle is to measure the components of an object by measuring the light reflected from the surface of the object with a light detector and measuring the intensities of the spectral lines at different wavelength positions. With the technological progress in miniaturization of spectrometers, the size of the devices of the spectrometers has been greatly reduced, and the size of small spectrometers based on, for example, infrared spectroscopy and Digital Light Processing (DLP) has been reduced to a pocket in which clothes can be put. However, the current miniaturized spectrometer device is still too large in size and is not suitable for being integrated into a mobile phone, and the miniaturized spectrometer is difficult to be integrated through a semiconductor process like other hardware modules of the mobile phone, that is, a part of limited space inside the mobile phone must be occupied separately, so that the popularization of a spectrum detection technology on an intelligent terminal device is not facilitated. On the other hand, although the spectrometer or the spectrum chip based on the micro-nano process and the optical detection array can be prepared by the semiconductor process, an optical layer structure meeting special requirements needs to be formed to provide a necessary light modulation effect, for example, CN112510059B discloses that the refractive index of the optical modulation structure needs to be controlled between 1 and 5, and the like, so that the spectrum detection technology is not easy to popularize in intelligent terminal equipment.
Therefore, a spectrum detection method, a storage medium, an electronic device and an apparatus are needed, which can fully utilize the existing highly integrated hardware module and functions of intelligent terminal devices such as mobile phones and tablet computers, so as to expand the applications of the intelligent terminal devices to cover multiple fields of biology, medicine, chemistry, food safety, environmental detection and the like based on the spectrum detection technology application, and facilitate the popularization of the spectrum detection technology on the intelligent terminal devices.
Disclosure of Invention
In a first aspect, embodiments of the present application provide a method for spectral detection. The spectrum detection method comprises the following steps: obtaining a first image when a reference light source is in an on state and a second image when the reference light source is in an off state by an imaging device, wherein the interval between the shooting time of the first image and the shooting time of the second image is less than a preset threshold value; obtaining a reference image according to the first image and the second image; and converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a 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 is subjected to pre-calibration processing. Wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device.
According to the technical scheme described in the first aspect, the specific optical layer structure and the light modulation structure can be provided by utilizing the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, a spectrum detection result can be accurately calculated from RGB (red, green and blue) intensity information contained in the reference image based on a conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
According to a possible implementation manner of the technical solution of the first aspect, an embodiment of the present application further provides that obtaining the reference image according to the first image and the second image includes: and carrying out pixel-level subtraction operation on the first image and the second image to obtain the reference image.
According to a possible implementation manner of the technical solution of the first aspect, the present application further provides that the analog detection process of the imaging apparatus includes that light emitted by a light source with a known emission spectrum is reflected by a reference object with known reflection properties and then received by the imaging apparatus.
According to a possible implementation manner of the technical solution of the first aspect, an embodiment of the present application further provides that the factory setting of the reference light source includes a spectral distribution of the reference light source measured at the time of factory shipment.
According to a possible implementation manner of the technical solution of the first aspect, an embodiment of the present application further provides that obtaining the reference image according to the first image and the second image includes: respectively identifying interesting regions ROI on the first image and the second image, and performing pixel-level subtraction operation on pixel points in the ROI of the first image and pixel points in the ROI of the second image to obtain the reference image.
According to a possible implementation manner of the technical solution of the first aspect, the embodiment of the present application further provides that an exposure time for obtaining the first image by the imaging device is adjustable.
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 based on a dynamic range of the imaging device, and the length of the exposure time is based on the intensity of the ambient light relative to the reference light source and/or a shooting distance at which the imaging device obtains the first image.
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 further based on the preset threshold.
According to a possible implementation manner of the technical solution of the first aspect, an 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 selectively enhance or reduce the RGB components in the light emitted by the reference light source according to the RGB components in the ambient light relative to the reference light source.
According to a possible implementation manner of the technical solution of the first aspect, embodiments of the present application further provide that the tunable filter is configured to selectively enhance or attenuate RGB components in the light emitted by the reference light source according to a spectral distribution in ambient light relative to the reference light source, and includes: 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 other RGB components in the light emitted by the reference light source; when the spectral distribution in the 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 and attenuate 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 acquisition device; an illumination device; and a processor. Wherein the processor is configured to perform the spectral detection method according to any of the first aspects and to use the image acquisition device as the imaging device and the illumination device as the reference light source.
According to the technical scheme described in the second aspect, the specific optical layer structure and the light modulation structure can be provided by utilizing the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, the spectrum detection result can be accurately calculated from the RGB intensity information contained in the reference image based on the conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
According to a possible implementation manner of the technical solution of the second aspect, an embodiment of the present application further provides that the mobile device is a mobile phone, the image capturing device is a camera on the mobile phone, and the illuminating device is an illuminating lamp on the mobile 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 which, when executed by a processor, implement the spectral detection method according to any one of the first aspects.
According to the technical scheme described in the third aspect, the specific optical layer structure and the light modulation structure can be provided by utilizing the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, the spectrum detection result can be accurately calculated from the information of the RGB intensity contained in the reference image based on the conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
In a fourth aspect, an embodiment of the present application provides an electronic device. The electronic device includes: a processor; a memory for storing processor-executable instructions. Wherein the processor implements the spectral detection method according to any of the first aspects by executing the executable instructions.
According to the technical scheme described in the fourth aspect, a specific optical layer structure and a light modulation structure can be provided by utilizing the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, a spectrum detection result can be accurately calculated from RGB (red, green and blue) intensity information contained in the reference image based on a conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology can be popularized on the intelligent terminal equipment.
In a fifth aspect, embodiments of the present application provide a spectrum detection apparatus. The spectrum detection device comprises: a reference light source; the imaging device is used for obtaining a first image when the reference light source is in an on state and a second image when the reference light source is in an off state, wherein the interval between the shooting time of the first image and the shooting time of the second image is less than a preset threshold value; a reference image generation module for obtaining a reference image according to the first image and the second image; and the conversion module is used for converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a conversion model so as to obtain a spectrogram corresponding to the reference image. Wherein, the conversion model is based on the factory setting of the reference light source and is subjected to pre-calibration processing. Wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device.
According to the technical scheme described in the fifth aspect, the specific optical layer structure and the light modulation structure can be provided by utilizing the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, the spectrum detection result can be accurately calculated from the information of the RGB intensity contained in the reference image based on the conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
According to a possible implementation manner of the technical solution of the fifth aspect, an exposure time of the imaging device to obtain the first image is adjustable, the adjustment of the exposure time is based on a dynamic range of the imaging device, and a length of the exposure time is based on an intensity of ambient light relative to the reference light source and/or a shooting distance of the imaging device to obtain the first image.
According to a possible implementation manner of the technical solution of the fifth aspect, an embodiment of the present application further provides that the spectrum detection apparatus further includes an adjustable filter for filtering the light emitted by the reference light source, and the adjustable filter is configured to selectively enhance or reduce the RGB components in the light emitted by the reference light source according to the RGB components in the ambient light relative to the reference light source.
According to a possible implementation manner of the technical solution of the fifth aspect, embodiments of the present application further provide that the tunable filter is configured to selectively enhance or attenuate the RGB components in the light emitted by the reference light source according to the RGB components in the 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 other RGB components in the light emitted by the reference light source; when the spectral distribution in the 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 and attenuate other RGB components in the light emitted by the reference light source.
In a sixth aspect, the present embodiment provides a mobile phone, wherein the mobile phone includes the spectrum detection apparatus according to any one of the fifth aspects, and the imaging apparatus is a camera on the mobile phone, and the reference light source is an illumination lamp on the mobile phone.
According to the technical scheme described in the sixth aspect, a specific optical layer structure and a light modulation structure can be provided by using the existing hardware module and functions of the intelligent terminal device without independently occupying space or 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 limited by setting a preset threshold value which is small enough, so that interference factors except a reference light source are effectively eliminated, and further, a spectrum detection result can be accurately calculated from RGB (red, green and blue) intensity information contained in the reference image based on a conversion model of the reference light source. Therefore, existing highly-integrated hardware modules and functions of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
According to a possible implementation manner of the technical solution of the sixth aspect, an 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 generation module and the conversion module are separately provided with respect to the processing device and integrated with the spectrum detection device.
Drawings
In order to explain the technical solutions in the embodiments or background art of the present application, the drawings used in the embodiments or background art of the present application will be described below.
Fig. 1 shows a schematic flow chart of a spectrum detection method provided in an embodiment of the present application.
Fig. 2 shows a block diagram of a spectrum detection apparatus provided in an embodiment of the present application.
Fig. 3 shows a block diagram of an electronic device for the spectrum detection method shown in fig. 1 according to an embodiment of the present application.
Fig. 4 shows a block diagram of a mobile phone with a spectrum detection function according to an embodiment of the present application.
Detailed Description
In order to solve the technical problem of popularization of a spectrum detection technology on intelligent terminal equipment, the embodiment of the application provides a spectrum detection method, a storage medium, electronic equipment and a device. Wherein the spectrum detection method comprises the following steps: obtaining a first image when a reference light source is in an on state and a second image when the reference light source is in an off state by an imaging device, wherein the interval between the shooting time of the first image and the shooting time of the second image is less than a preset threshold value; obtaining a reference image according to the first image and the second image; and converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a 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 is subjected to pre-calibration processing. Wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device. The embodiment of the application has the following beneficial technical effects: the existing highly integrated hardware module and function of intelligent terminal equipment such as mobile phones and tablet computers can be fully utilized, so that the purposes of the intelligent terminal equipment are expanded to cover multiple fields such as biology, medicine, chemistry, food safety and environment detection based on spectrum detection technology application, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
The embodiments of the present application may be used in application scenarios including, but not limited to, spectroscopic detection, spectroscopic analysis, biological component detection, medical health, food safety, environmental detection, and the like.
The embodiments of the present application may be modified and improved according to specific application environments, and are not limited herein.
In order to make the technical field of the present application better understand, embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Fig. 1 shows a schematic flow chart of a spectrum detection method provided in an embodiment of the present application. As shown in fig. 1, the method includes the following steps.
Step S102: the method comprises the steps of obtaining a first image when a reference light source is in an on state and a second image when the reference light source is in an off state through an imaging device, wherein the interval between the shooting time of the first image and the shooting time of the second image is smaller than a preset threshold value.
Step S104: and obtaining a reference image according to the first image and the second image.
Step S106: converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a 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 is subjected to pre-calibration treatment; the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device.
Referring to the above steps S102 to S106, in step S102, by requiring the interval between the capturing time of the first image and the capturing time of the second image to be less than the preset threshold, and by setting the preset threshold to be small enough, the difference between the first image and the second image can be almost determined by whether there is illumination of the reference light source. This makes it possible to obtain a reference image equivalent to an image obtained only under the illumination condition of the reference light source by obtaining the reference image from the first image and the second image in step S104. In some embodiments, the requirement for a preset threshold, i.e. the requirement for the interval between the capturing time of the first image and the capturing time of the second image, may be reduced by arranging for a relatively stable capturing environment. For example, when the spectrum detection method shown in fig. 1 is used in a food safety scene, a food sample whose component needs to be measured can be placed indoors and has stable indoor lighting conditions, for example, only indoor lighting equipment is used when a curtain is closed, which is beneficial to keep the time when the first image is captured and the time when the second image is captured substantially the same except that the reference light source is in an on state or an off state, so that the influence of the reference light source can be kept by canceling the factors kept unchanged through corresponding operation performed in step S104, such as pixel-level subtraction operation or other operation. However, in other embodiments, it may be difficult to provide a relatively stable shooting environment, for example, a scene for human medical health detection such as a hospital, or a scene for environmental detection such as a sewage disposal site, etc., which requires a sufficiently small interval between the shooting time of the first image and the shooting time of the second image, that is, a certain requirement on the shooting speed or shutter speed of the imaging apparatus. This can be set in conjunction with the capabilities of the imaging device specifically employed, which may be, for example, a professional high-speed camera and which can provide a shutter speed of two thousandths of a second or at most two thousand images per second. Generally, the spectrum detection method is mainly applied to intelligent terminal devices such as smart phones, and smart phones are also generally equipped with cameras with better performance and provide a fast shooting mode, for example, a camera on a mobile phone can achieve a shutter shooting speed of 1/125-1/500 in daily shooting, that is, 125-500 images per second can be shot. Such shutter speed is sufficient to catch moving pedestrians, bicycles, and the like in the case of daily shooting. In summary, depending on the interference factors other than the reference light source under the specific shooting condition, including ambient light, background light, reflected light, and other light sources, a preset threshold value small enough to limit the interval between the shooting time of the first image and the shooting time of the second image can be set, so as to overcome the influence of the interference factors, and thus the difference between the obtained first image and the second image is almost derived from the factor of whether the reference light source is illuminated or not.
In step S104, a reference image is obtained according to the first image and the second image. It was mentioned above that the first image corresponding to the reference light source being in the on-state and the second image corresponding to the reference light source being in the off-state may be equivalent to considering the first image as representing R by setting a sufficiently small preset threshold value, for example in combination with specific photographing conditions and disturbance factors, in addition to the change of state of the reference light source F+A Where R represents a function of RGB intensities of a pixel point on an image or a distribution of RGB intensities, F represents a reference light source, and a represents factors other than the reference light source that can affect the RGB intensities (these factors are considered as interference factors with respect to the reference light source). The second image represents R A It is assumed here that a in the second image, i.e. the disturbing factor, is the same as or substantially the same as a in the first image. Thus, by performing a suitable operation on the first image and the second image, for example a pixel-level subtraction operation, that is equivalent to performing R F+A Subtracting R A Of the reference image thus obtained, which represents R F That is, only the factor of F, i.e., the reference light source, remains on the reference image.
In step S106, the RGB intensities of the pixels on the reference image are converted into corresponding spectral intensities through the conversion model, so as to obtain a spectrogram corresponding to the reference image. As mentioned above, the reference image represents R F I.e. the RGB intensities of the pixels affected only by the reference light source. The conversion model may be denoted as T and the spectral intensity distribution may be denoted as R (λ). By calculating R F x T = R (λ), it is possible to obtain the corresponding spectral intensity of a pixel point on the reference image from the RGB intensity of the pixel point of the reference image and the conversion model T. The spectrogram obtained in the way is a spectrum detection result, can be further used for analyzing and processing to determine substance components, and is suitable for a plurality of fields of biology, medicine, chemistry, food safety, environmental detection and the like based on the spectrum detection technology.
The key to the spectrum detection method that can provide a good spectrum detection result is the conversion model T, that is, the conversion model T must be able to achieve the conversion from the RGB intensities of the pixel points of the reference image to the corresponding spectrum intensities with sufficient accuracy. Factors that may disturb the accuracy of the conversion model T, i.e. the performance of the above-described spectral detection method, are derived from other light sources than the reference light source. This is because other light sources than the reference light source are often uncontrollable and highly random, such as natural light, ambient light, etc., which makes it impossible to build a sufficiently accurate conversion model to take these possible interference factors into account. As described above, the interval between the capturing time of the first image and the capturing time of the second image is defined by setting a preset threshold value small enough, and then an operation is performed so as to effectively exclude the disturbance factor other than the reference light source. In addition, the conversion model T is based on the factory setting of the reference light source and is subjected to pre-calibration treatment; the pre-calibration process for the conversion model T is based on an analog detection process of the imaging device. Here, the factory setting of the reference light source may be considered to represent the conversion model T of the reference light source at the time of factory shipment, that is, the above calculation may be completed by the factory setting of the reference light source, so as to obtain the corresponding spectral intensity of the pixel point on the reference image according to the RGB intensity of the pixel point of the reference image and the conversion model T. Considering that the reference light source may be subjected to various conditions such as device aging and loss during the use process after the shipment, and thus deviate from the factory setting, the conversion model of the current reference light source needs to be determined through the pre-calibration process. In addition, even if the reference light source maintains the factory setting, there may be aging or wear of other devices, so that the reference light source may be externally displayed to deviate from the factory setting. For this purpose, the conversion model T can be calibrated by performing a simulated detection process of the imaging device, i.e. performing a spectral detection with the current imaging device and the current reference light source simulation and comparing the detection result with the reference result, and then performing appropriate processing.
It can be seen that, in the above-mentioned spectrum detection method, existing hardware modules and functions of the smart terminal device can be utilized, for example, the lighting device on the mobile phone is utilized as a reference light source and the camera on the mobile phone is utilized as an imaging device, so that a specific optical layer structure and a light modulation structure are not required to be provided by a single occupied space or a complicated micro-nano process, and a sufficiently small preset threshold is set to limit an interval between a shooting time of the first image and a shooting time of the second image (for example, set to a shutter shooting speed of a pedestrian in shooting motion), and then an operation is performed to effectively eliminate interference factors except for the reference light source, so that a spectrum detection result can be accurately calculated from RGB intensity information included in the reference image based on a conversion model of the reference light source. The spectrum detection method can fully utilize the existing highly-integrated hardware module and functions of intelligent terminal equipment such as mobile phones and tablet computers, so that the purposes of the intelligent terminal equipment are expanded to cover multiple fields of biology, medicine, chemistry, food safety, environment detection and the like based on the spectrum detection technology application, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
In a possible embodiment, the reference image is derived from the first image and the second image. The method comprises the following steps: and carrying out 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 modes may be used as long as the interference factors other than the reference light source are effectively excluded.
In one possible embodiment, the analog detection process of the imaging device includes reflecting light emitted from a light source having a known emission spectrum by a reference object having known reflective properties and receiving the reflected light by the imaging device. In some embodiments, the reference object is a white test plate. As described above, the pre-calibration of the conversion model T can be completed by the simulation detection process of the imaging device, i.e., performing a spectrum detection once with the current imaging device and the current reference light source simulation and comparing the detection result with the reference result, and then performing appropriate processing. Here, with a reference object such as a white test board, the reflection property itself is judged in advance and therefore the spectral detection result after reflection by the reference object, that is, the reference result, can be estimated, and the spectral intensity distribution of the reflected light can be estimated from the known attenuation characteristic of the reference object and the spectral intensity distribution of the incident light, for example. In general, a reference object, such as a monochromatic test plate or the like, having uniform reflectance properties or relatively simple reflectance properties, whose reflectance properties are known or easily estimated. The conversion model T can thus be pre-calibrated by the above-described simulation test procedure. It should be understood that instead of a white test plate, other reference objects of known reflective nature may be used, provided that their spectral detection results are conveniently pre-estimated. It is also contemplated to use test panels of different colors that fit together or that have other patterns or patterns.
In a possible embodiment, the factory setting of the reference light source comprises a spectral distribution of the reference light source measured at the time of factory shipment. 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 estimated more favorably.
In a possible implementation, obtaining the reference image according to the first image and the second image includes: respectively identifying interesting regions ROI on the first image and the second image, and carrying out pixel-level subtraction operation on pixel points in the ROI of the first image and pixel points in the ROI of the second image to obtain the reference image. In consideration of the fact that in practical application, a sample needing to be subjected to spectral analysis detection may only occupy a part of region on an image, for example, a part of region of a food sample to be detected in the center of the image in a food safety scene, therefore, resource analysis processing of spectral information in the ROI can be concentrated through the ROI, so that limited computing resources on intelligent terminal equipment can be better utilized, and energy consumption can be reduced.
In a possible embodiment, 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 a dynamic range of the imaging device, and the length of the exposure time is based on an intensity of ambient light relative to the reference light source and/or a capture distance at which the imaging device obtains the first image. In some embodiments, the adjustment of the exposure time is further based on the preset threshold. It is mentioned above that the first image corresponding to the reference light source is in the on state, 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 is too saturated, and if the exposure time is too short, the signal may be too weak, and the signal-to-noise ratio is too high. By adjusting the exposure time of the first image, in particular according to the dynamic range, the signal-to-noise ratio can be increased, which helps to overcome the stronger noise interference caused by the situation that the background light is too strong or the reference light source is too weak relative to the background light. In addition, the length of the exposure time can be adjusted more flexibly based on the intensity of the ambient light relative to the reference light source and/or the shooting distance at which the imaging device obtains the first image, in combination with the practically applicable needs. For example, in the industrial detection scene such as sewage detection, it is generally required to perform spectral analysis detection on a large area of sewage at a long distance, and in this case, the imaging device is suitable to adjust the exposure time to improve the signal-to-noise ratio if the shooting distance for obtaining the first image is long. As another example, in a situation where the room may be exposed to too strong background light, such as too high brightness of the room lighting, in which case the intensity of the ambient light with respect to the reference light source is too high, it may be appropriate to adjust the exposure time to overcome the interference of the too strong background light. For another example, when the background light is not so strong and the shooting distance is short, the exposure time can be adjusted to fully utilize the dynamic range, thereby obtaining a better detection effect. In addition, the adjustment of the exposure time may also be based on the preset threshold, and the function of the above-mentioned preset threshold is to define the interval between the moment of capturing the first image and the moment of capturing the second image so as to suppress the influence of the interference factor, so the exposure time may be adjusted in combination with the preset threshold to further suppress the interference and improve the signal-to-noise ratio.
In one possible embodiment, the light emitted by the reference light source is filtered by an adjustable filter configured to selectively enhance or attenuate the RGB components of the light emitted by the reference light source based on the RGB components of the ambient light relative to the reference light source. Here, the filtering by the tunable filter changes the spectral distribution of the light emitted by the reference light source, for example, the filtering by the green filter results in a spectral distribution that is predominantly green. The RGB components in the ambient light relative to the reference light source are the above-mentioned interference factors that need to be suppressed and can adversely affect the spectrum 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 environment light relative to the reference light source, so that the influence of the environment light is suppressed, and the influence of the reference light source is enhanced, thereby improving the signal-to-noise ratio and the detection effect. In some embodiments, the tunable filter is configured to selectively enhance or attenuate RGB components in the 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 other RGB components in the light emitted by the reference light source; when the spectral distribution in the 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 and attenuate other RGB components in the light emitted by the reference light source. Therefore, when the RGB components in the ambient light are mainly blue light, which may be the case in a factory workshop or a laboratory or the like using a blue light lamp or a blue light-based lighting device, the signal-to-noise ratio can be improved by enhancing the R component or the G component of the reference light source while attenuating the other components. This is often the case in the semiconductor manufacturing industry when the RGB components of ambient light are predominantly yellow light, where ultra clean rooms and the like typically use yellow light-based lighting devices, and at this time, the signal-to-noise ratio can be improved by enhancing the B component of the reference light source while attenuating other components.
It is to be understood that the above-described method may be implemented by a corresponding execution 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 above-described method and any of the above-described embodiments, implementations, or combinations thereof. In some example embodiments, an electronic device includes: a processor; a memory for storing processor-executable instructions; wherein the processor implements the above method and any of the above embodiments, implementations, or combinations thereof by executing the executable instructions.
In addition, the method can be implemented by a mobile device or any suitable intelligent terminal device. For example, a mobile device includes: an image acquisition device; an illumination device; and a processor. Wherein the processor is configured to perform the above spectral detection method and to use the image acquisition device as the imaging device and the illumination device as the reference light source. The mobile device may be a mobile phone, a tablet computer, or any suitable device or smart terminal device, provided that the necessary components such as the imaging device and the reference light source are provided. The image capturing device may be any suitable device on the mobile device, for example, there may be multiple cameras or cameras with shooting function on a mobile phone, and any one of the cameras or cameras may be used as the imaging device. The illumination device may be a back light, such as a back light of a mobile phone, provided on the mobile device, or may be an additional or additional illumination device provided, for example, as a kit, as long as the details regarding the above-described spectral detection method are satisfied.
Fig. 2 shows a block diagram of a spectrum detection apparatus provided in an embodiment of the present application. As shown in fig. 2, the spectrum detecting apparatus includes: a reference light source 210; an imaging device 220, configured to obtain a first image when the reference light source 210 is in an on state and a second image when the reference light source 210 is in an off state, where an interval between a shooting time of the first image and a shooting time of the second image is smaller than a preset threshold; a reference image generating module 230, configured to obtain a reference image according to the first image and the second image; the converting module 240 is configured to convert, through a conversion model (not shown), the RGB intensities of the pixel points on the reference image into corresponding spectral intensities, so as to obtain a spectral diagram corresponding to the reference image. Wherein the conversion model is based on factory settings of the reference light source 210 and is pre-calibrated. Wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device 220. It should be understood that the spectrum detection apparatus may be understood as a part of the intelligent terminal device, in a manner integrated with the intelligent terminal device or in addition thereto, and may also be understood as a manner of invoking an existing hardware module of the intelligent terminal device in a manner of software such as an instruction or a program or an application to implement a corresponding function, which is not specifically limited herein. Also, the reference light source 210 is communicatively coupled to the imaging device 220 such that the imaging device 220 may obtain the first and second images and complete the analog detection process with the reference light source 210. The image obtained by the imaging device 220 is transmitted to the reference image generation module 230, and then transmitted to the transformation module 240 by the reference image generation module 230. The conversion module 240 is further connected to the reference light source 210 for determining a conversion model based on factory settings and a pre-calibration process of the reference light source 210.
The spectrum detection device can utilize the existing hardware module and functions of the intelligent terminal device, such as the lighting device on the mobile phone as the reference light source 210 and the camera on the mobile phone as the imaging device 220, so that a specific optical layer structure and a light modulation structure are provided without occupying space independently or through a complex micro-nano process, the interval between the shooting time of the first image and the shooting time of the second image is limited by setting a preset threshold value which is small enough (for example, the shooting speed of a shutter of a pedestrian in shooting motion is set), then operation is carried out, interference factors except the reference light source are effectively eliminated, and the spectrum detection result can be accurately calculated from the information of RGB intensity contained in the reference image based on the conversion model of the reference light source. The spectrum detection device can make full use of the existing highly-integrated hardware module and functions of intelligent terminal equipment such as mobile phones and tablet computers, so that the purposes of the intelligent terminal equipment are expanded to cover multiple fields of biology, medicine, chemistry, food safety, environment detection and the like based on spectrum detection technology application, and the spectrum detection technology is favorably popularized on the intelligent terminal equipment.
In a possible embodiment, the exposure time for the imaging device 220 to obtain the first image is adjustable, the adjustment of the exposure time is based on the dynamic range of the imaging device 220, and the length of the exposure time is based on the intensity of the ambient light relative to the reference light source 210 and/or the shooting distance for the imaging device 220 to obtain the first image. In this way, the signal-to-noise ratio can be increased, which helps to overcome the stronger noise interference in case the background light is too strong or the reference light source is too weak with respect to the background light.
In one possible embodiment, the spectral detection apparatus further includes a tunable filter (not shown) for filtering the light emitted by the reference light source 210, the tunable filter being configured to selectively enhance or attenuate the RGB components of the light emitted by the reference light source 210 according to the RGB components of the ambient light relative to the reference light source 210. In this way, the influence of the ambient light can be suppressed while the influence of the reference light source 210 is enhanced, which can improve the signal-to-noise ratio and improve the detection effect.
In one possible embodiment, the tunable filter is configured to selectively enhance or attenuate the RGB components of the light emitted by the reference light source 210 according to the RGB components of the ambient light relative to the reference light source 210, 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 other RGB components in the light emitted by the reference light source 210; when the spectral distribution in the 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 the other RGB components in the light emitted by the reference light source 210. In this way, the influence of the ambient light can be suppressed while the influence of the reference light source 210 is enhanced, which can improve the signal-to-noise ratio and improve the detection effect.
Fig. 3 shows a block diagram of an electronic device for the spectrum detection method shown in fig. 1 according to an embodiment of the present application. As shown in fig. 3, the electronic device includes a main processor 302, an internal bus 304, a network interface 306, a main memory 308, and secondary processor 310 and secondary memory 312, as well as a secondary processor 320 and secondary memory 322. The main processor 302 is connected to the main memory 308, and the main memory 308 can be used for storing computer instructions executable by the main processor 302, so that the spectrum detection method shown in fig. 1 can be implemented, including some or all of the steps, and any possible combination or combination and possible replacement or variation of the steps. The network interface 306 is used to provide network connectivity and to transmit and receive data over a network. The internal bus 304 is used to provide internal data interaction between the main processor 302, the network interface 306, the auxiliary processor 310, and the auxiliary processor 320. The secondary processor 310 is coupled to the secondary memory 312 and provides secondary computing power, and the secondary processor 320 is coupled to the secondary memory 322 and provides secondary computing power. The auxiliary processors 310 and 320 may provide the same or different auxiliary computing capabilities including, but not limited to, computing capabilities optimized for particular computing needs such as parallel processing capabilities or tensor computing capabilities, computing capabilities optimized for particular algorithms or logic structures such as iterative computing capabilities or graph computing capabilities, or the like. The secondary processor 310 and the secondary processor 320 may include one or more processors of a particular type, such as a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or the like, so that customized functions and structures may be provided. In some exemplary embodiments, the electronic device may not include an auxiliary processor, may include only one auxiliary processor, and may include any number of auxiliary processors and each have a corresponding customized function and structure, which are not specifically limited herein. The architecture of the two auxiliary processors shown in FIG. 3 is illustrative only and should not be construed as limiting. In addition, the main processor 302 may include a single-core or multi-core computing unit for providing the functions and operations necessary for the embodiments of the present application. In addition, the main processor 302 and the auxiliary processors (such as the auxiliary processor 310 and the auxiliary processor 320 in fig. 3) may have different architectures, that is, the electronic device may be a heterogeneous architecture based system, for example, the main processor 302 may be a general-purpose processor based on an instruction set operating system, such as a CPU, and the auxiliary processor may be a graphics processor GPU suitable for parallelized computation or a dedicated accelerator suitable for neural network model-related operations. The auxiliary memory (e.g., auxiliary memory 312 and auxiliary memory 322 shown in fig. 3) may be used to implement customized functions and structures with the respective auxiliary processors. While main memory 308 is operative to store the necessary instructions, software, configurations, data, etc. to provide the functionality and operations necessary for embodiments of the subject application in conjunction with main processor 302. In some exemplary embodiments, the electronic device may not include the auxiliary memory, may include only one auxiliary memory, and may further include any number of auxiliary memories, which is not specifically limited herein. The architecture of the two auxiliary memories shown in fig. 3 is illustrative only and should not be construed as limiting. Main memory 308, and possibly secondary memory, may include one or more of the following features: volatile, nonvolatile, dynamic, static, readable/writable, read-only, random-access, sequential-access, location-addressability, file-addressability, and content-addressability, and may include random-access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, a hard disk, a removable disk, a recordable and/or rewriteable Compact Disc (CD), a Digital Versatile Disc (DVD), a mass storage media device, or any other form of suitable storage media. The internal bus 304 may include any of a variety of different bus structures or combinations of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and/or a processor or local bus that utilizes any of a variety of bus architectures. It should be understood that the electronic device shown in fig. 3, the illustrated structure of which does not constitute a specific limitation as to the apparatus or system, may in some exemplary embodiments include more or less components than the specific embodiments and figures, or combine certain components, or split certain components, or have a different arrangement of components.
Fig. 4 shows a block diagram of a mobile phone with a spectrum detection function according to an embodiment of the present application. As shown in fig. 4, the mobile phone includes an illumination lamp 410, a camera 420, a processing device 430, and a memory 440. The mobile phone shown in fig. 4 may include the spectrum detection device described above, and the imaging device 220 is a camera 420 on the mobile phone, and the reference light source 210 is an illumination lamp 410 on the mobile phone. The reference image generation module 230 and the conversion module 240 are implemented by a processing device 430 on the mobile phone, or the reference image generation module 230 and the conversion module 240 are provided separately from the processing device 430 and integrated with the spectrum detection device.
It should be understood that the above-described spectral detection method can be accomplished by operating the illumination lamp 410 and the camera 420 by means of the processing device 430 on the mobile phone by executing a program or instructions stored in the memory 440, i.e., the reference image generation module 230 and the transformation module 240 are realized by the processing device 430 on the mobile phone. In other embodiments, the reference image generation module 230 and the conversion module 240 may be provided separately, for example, by way of pluggable accessories, such as an integrated spectrum detection device, which as a whole may be connected to a mobile phone via, for example, a USB interface and provide an expanded spectrum detection function.
The embodiments provided herein may be implemented in any one or combination of hardware, software, firmware, or solid state logic circuitry, and may be implemented in connection with signal processing, control, and/or application specific circuitry. Particular embodiments of the present application provide an apparatus or device that may include one or more processors (e.g., microprocessors, controllers, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), etc.) that process various computer-executable instructions to control the operation of the apparatus or device. Particular embodiments of the present application provide an apparatus or device that can include a system bus or data transfer system that couples the various components together. A system bus can include any of a variety of different bus structures or combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and/or a processor or local bus that utilizes any of a variety of bus architectures. The devices or apparatuses provided in the embodiments of the present application may be provided separately, or may be part of a system, or may be part of other devices or apparatuses.
Particular 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 store data, programmers and/or instructions that, when executed by a processor of an apparatus or device provided by embodiments of the present application, cause the apparatus or device to perform operations associated therewith. The computer-readable storage medium/storage device may include one or more of the following features: 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 a device or apparatus provided in the embodiments of the present application or belong to a common system. The computer-readable storage medium/memory device may include optical, semiconductor, and/or magnetic memory devices, etc., and may also include Random Access Memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, a hard disk, a removable disk, a recordable and/or rewriteable Compact Disc (CD), a Digital Versatile Disc (DVD), a mass storage media device, or any other form of suitable storage media.
The above is an implementation manner of the embodiments of the present application, and it should be noted that the steps in the method described in the embodiments of the present application may be sequentially adjusted, combined, and deleted according to actual needs. In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments. It is to be understood that the embodiments of the present application and the structures shown in the drawings are not to be construed as particularly limiting the devices or systems concerned. In other embodiments of the present application, an apparatus or system may include more or fewer components than the specific embodiments and figures, or may combine certain components, or may separate certain components, or may have a different arrangement of components. Those skilled in the art will understand that various modifications and changes may be made in the arrangement, operation, and details of the methods and apparatus described in the specific embodiments without departing from the spirit and scope of the embodiments herein; without departing from the principles of embodiments of the present application, several improvements and modifications may be made, and such improvements and modifications are also considered to be within the scope of the present application.

Claims (11)

1. A method of spectral detection, the method comprising:
obtaining a first image of the same area where the same sample is located when a reference light source is in an on state and a second image of the same area where the reference light source is in an off state by an imaging device, wherein the interval between the shooting time of the first image and the shooting time of the second image is smaller than a preset threshold value;
carrying out pixel level subtraction operation on the first image and the second image to obtain the reference image; and
converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a conversion model so as to obtain a spectrogram corresponding to the reference image and obtain a spectral detection result of the same sample based on the spectrogram,
wherein the conversion model is based on the factory setting of the reference light source and is pre-calibrated to correct the deviation from the factory setting of the reference light source,
wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device,
wherein the exposure time for obtaining the first image by the imaging device is adjustable, the adjustment of the exposure time is based on a dynamic range of the imaging device, and the length of the exposure time is based on the intensity of the ambient light relative to the reference light source and the shooting distance for obtaining the first image by the imaging device, the adjustment of the exposure time is further based on the preset threshold,
wherein the light emitted by the reference light source is filtered by an adjustable filter configured to selectively enhance or attenuate RGB components in the light emitted by the reference light source as a function of RGB components in ambient light relative to the reference light source,
wherein the tunable filter is configured to enhance an R component or a G component in the light emitted by the reference light source and attenuate other RGB components in the light emitted by the reference light source when the spectral distribution in the ambient light is dominated by blue light,
wherein the tunable filter is configured to enhance a B component of the light emitted by the reference light source and attenuate other RGB components of the light emitted by the reference light source when the spectral distribution in the ambient light is predominantly yellow,
wherein the interval between the capturing time of the first image and the capturing time of the second image is defined by setting the preset threshold value small enough so that the difference between the first image and the second image almost comes from whether the reference light source is illuminated or not, thereby effectively eliminating interference factors except the reference light source,
the spectrum detection method is applied to human medical health detection scenes or environment detection scenes, and the imaging device is a professional high-speed camera and can provide a shutter shooting speed of two thousandths of a second.
2. The method of claim 1, wherein simulating detection by the imaging device comprises reflecting light emitted by a light source having a known emission spectrum by a reference object having known reflective properties and receiving the reflected light by the imaging device.
3. The method of claim 1, wherein the factory setting of the reference light source comprises a factory measured spectral distribution of the reference light source.
4. The method of claim 1, wherein performing a pixel-level subtraction operation on the first image and the second image to obtain the reference image comprises:
a region of interest ROI is identified on the first image and the second image respectively,
and carrying out pixel level subtraction operation on pixel points in the ROI of the first image and pixel points in the ROI of the second image to obtain the reference image.
5. A mobile device, characterized in that the mobile device comprises:
an image acquisition device;
an illumination device; and
a processor for processing the received data, wherein the processor is used for processing the received data,
wherein the processor is configured to perform the spectral detection method of any of claims 1 to 4 and to use the image acquisition device as the imaging device and the illumination device as the reference light source.
6. The mobile device of claim 5, wherein the mobile device is a cell phone, wherein the image capture device is a camera on the cell phone, and wherein the illumination device is a light on the cell phone.
7. A non-transitory computer readable storage medium storing computer instructions which, when executed by a processor, implement the spectral detection method of any one of claims 1 to 4.
8. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the spectral detection method of any of claims 1 to 4 by executing the executable instructions.
9. A spectral detection apparatus, comprising:
a reference light source;
the imaging device is used for obtaining a first image of the same area where the same sample is located when the reference light source is in an on state and a second image of the same area where the reference light source is in an off state, wherein the interval between the shooting time of the first image and the shooting time of the second image is smaller than a preset threshold value;
the reference image generation module is used for carrying out pixel level subtraction operation according to the first image and the second image to obtain a reference image; and
a conversion module for converting the RGB intensity of each pixel point on the reference image into corresponding spectral intensity through a conversion model, thereby obtaining a spectrogram corresponding to the reference image and obtaining a spectral detection result of the same sample based on the spectrogram,
wherein the conversion model is based on the factory setting of the reference light source and is pre-calibrated to correct the deviation from the factory setting of the reference light source,
wherein the pre-calibration process for the conversion model is based on a simulated detection process of the imaging device,
wherein the exposure time for obtaining the first image by the imaging device is adjustable, the adjustment of the exposure time is based on a dynamic range of the imaging device, and the length of the exposure time is based on the intensity of the ambient light relative to the reference light source and the shooting distance for obtaining the first image by the imaging device, the adjustment of the exposure time is further based on the preset threshold,
wherein the spectral detection apparatus further comprises an adjustable filter for filtering the light emitted by the reference light source, the adjustable filter being configured to selectively enhance or attenuate RGB components in the light emitted by the reference light source according to RGB components in ambient light relative to the reference light source,
wherein the tunable filter is configured to enhance an R component or a G component in the light emitted by the reference light source and attenuate other RGB components in the light emitted by the reference light source when the spectral distribution in the ambient light is dominated by blue light,
wherein the tunable filter is configured to enhance a B component of the light emitted by the reference light source and attenuate other RGB components of the light emitted by the reference light source when the spectral distribution in the ambient light is predominantly yellow,
wherein the interval between the capturing time of the first image and the capturing time of the second image is defined by setting the preset threshold value small enough so that the difference between the first image and the second image almost comes from whether the reference light source is illuminated or not, thereby effectively eliminating interference factors except the reference light source,
the spectrum detection method is applied to human medical health detection scenes or environment detection scenes, and the imaging device is a professional high-speed camera and can provide a shutter shooting speed of two thousandths of a second.
10. A mobile phone characterized in that it comprises a spectral detection device according to claim 9 and the imaging device is a camera on the mobile phone and the reference light source is an illumination lamp on the mobile phone.
11. The handset according to claim 10, wherein the reference image generation module and the conversion module are implemented by processing means on the handset, or the reference image generation module and the conversion module are provided separately from the processing means and integrated with the spectral detection means.
CN202210311268.1A 2022-03-28 2022-03-28 Spectrum detection method, storage medium, electronic device, and apparatus Active CN114414500B (en)

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 Active 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)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
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
EP3977073B1 (en) * 2019-05-29 2023-06-07 Yara International ASA Method for estimating 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

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
EP2810046A1 (en) Method and system for analyzing a colorimetric assay
Nixon et al. Accurate device-independent colorimetric measurements using smartphones
CN108204979B (en) Method and device for calibrating light source in test paper detection equipment
US11835515B2 (en) Method for evaluating suitability of lighting conditions for detecting an analyte in a sample using a camera of a mobile device
CN112985589A (en) Ambient light illumination detection method, ambient light illumination detection device, correction coefficient calculation method, correction coefficient calculation device and electronic equipment
WO2017019762A1 (en) Image based photometry
Bao et al. A remote computing based point-of-care colorimetric detection system with a smartphone under complex ambient light conditions
Thakur et al. Smartphone-based, automated detection of urine albumin using deep learning approach
CN113639881A (en) Color temperature testing method and device, computer readable medium and electronic equipment
CN106846295A (en) The assay method and device of the soil organism
CN114414500B (en) Spectrum detection method, storage medium, electronic device, and apparatus
KR102136194B1 (en) Light control apparatus for colorimetric and method thereof
AU2020308586A1 (en) Method of determining a concentration of an analyte in a bodily fluid and mobile device configured for determining a concentration of an analyte in a bodily fluid
JP2009182845A (en) Apparatus and method for processing image
RU2791099C2 (en) Method for determining analyte in a sample
Javoršek et al. Comparison of two digital cameras based on spectral data estimation obtained with two methods
RU2791101C2 (en) Method for assessment of lighting condition suitability for analyte determination in sample, using mobile device camera
JP2009181449A (en) Image processor and image processing method
CN114216573A (en) Color temperature detection method and device, computer readable medium and electronic equipment
Brauers et al. Multispectral imaging with flash light sources
Hyttinen Optical implementation of partially negative filters using a spe
CN114755228A (en) Detection instrument and detection method for chlorophyll and nitrogen contents of cotton leaves
JP2022006624A (en) Calibration device, calibration method, calibration program, spectroscopic camera, and information processing device
CN117676348A (en) Intelligent equipment and method for acquiring and calibrating spectral sensitivity of image sensor of intelligent equipment

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