Disclosure of Invention
In view of the above problems, the present invention is directed to a digital intelligent color sensor system.
The purpose of the invention is realized by adopting the following technical scheme:
the invention discloses a digital intelligent color sensor system, which comprises a processor module, a signal sensing module, a control module and a signal processing module, wherein the processor module is used for processing a color signal; the processor module is respectively connected with the signal sensing module, the control module and the signal processing module, and the signal sensing module is connected with the signal processing module;
the signal sensing module is used for emitting a detection light source and receiving light signals, wherein the received light signals comprise red light signals, green light signals and blue light signals;
the control module is used for detecting the light intensity of the object to be detected and outputting a corresponding control instruction according to the light intensity detection result to adjust the intensity of the detection light source emitted by the signal sensing module;
the signal processing module is used for carrying out signal processing according to the received optical signal and outputting an AD sampling signal to the processor module;
the processor module carries out analysis processing according to the received AD sampling signal to obtain a color detection result.
In one embodiment, the signal sensing module comprises a light source unit, an RGB optical signal acquisition unit, and a white light signal acquisition unit; wherein,
the light source unit is used for providing a white light source;
the RGB optical signal acquisition unit comprises a photosensitive acquisition unit which is respectively provided with a red light filter device, a green light and green light device and a blue light filter device and is used for respectively acquiring red light signals, green light signals and blue light signals and transmitting the acquired red light signals, green light signals and blue light signals to the signal processing module;
the white light signal acquisition unit is used for directly acquiring a white light signal reflected by the white light source after the white light source irradiates an object, and transmitting the acquired white light signal to the signal processing module.
In one embodiment, the control module comprises a light intensity feedback unit and a light source control unit;
the light intensity feedback unit is used for carrying out light intensity detection according to the received white light signal and acquiring a light intensity detection value;
the light source control unit is used for judging according to the acquired light intensity detection value, and when the light intensity detection value is weakened or smaller than a set threshold value, a compensation control signal is sent to the light source unit so as to control the light source unit to adjust the light source brightness.
In one embodiment, the system further comprises an external detection module;
the external detection module is used for being connected with the external detection head, sampling optical signals through the external detection head and transmitting the optical signals sampled through the external detection head to the signal processing module;
the processor module comprises a signal selection unit, wherein the signal selection unit is respectively connected with the signal sensing module and the external detection module; when the external detection module is detected to be connected with the external detection head, the signal selection unit cuts off signal sampling of the signal sensing module and selects the external detection head connected with the external detection module to perform optical signal sampling.
In one embodiment, the signal processing module comprises an AD conversion unit, a preprocessing unit and an amplifying unit which are connected in sequence; wherein
The AD conversion unit is used for carrying out analog-to-digital conversion processing on the received optical signal to obtain an AD sampling signal; wherein the received optical signal includes a red light signal, a green light signal, a blue light signal, a white light signal transmitted by the signal sensing module, or an optical signal transmitted by the external detection module.
The preprocessing unit is used for filtering the acquired AD sampling signal and outputting a preprocessed AD sampling signal;
the amplifying unit is used for amplifying the pre-processed AD sampling signal and outputting the amplified AD sampling signal.
In one embodiment, the filtering processing performed by the preprocessing unit on the obtained AD sampling signal specifically includes:
performing empirical mode decomposition on the obtained AD sampling signal to obtain an IMF component of the AD sampling signal;
dividing the obtained IMF components into low-frequency IMF components and high-frequency IMF components, and reconstructing according to the low-frequency IMF components to obtain low-frequency signals; reconstructing according to the high-frequency IMF component to obtain a high-frequency signal;
performing wavelet decomposition processing on the low-frequency signal by adopting a set wavelet basis and a set decomposition scale to obtain a high-frequency wavelet coefficient and a low-frequency wavelet coefficient of the low-frequency signal, performing threshold processing on the obtained high-frequency wavelet coefficient, and obtaining a high-frequency wavelet coefficient after the threshold processing;
reconstructing the low-frequency wavelet coefficient and the high-frequency wavelet coefficient after threshold processing to obtain a filtered low-frequency signal;
carrying out weighted median filtering processing on the high-frequency signal to obtain a filtered high-frequency signal;
and reconstructing the filtered low-frequency signal and the filtered high-frequency signal to obtain a preprocessed AD sampling signal.
In one embodiment, the processor module comprises a power supply unit, a storage unit, and a color conversion unit; wherein
The power supply unit is respectively connected with each module of the system and used for supplying power to each module of the system;
the storage unit is used for storing system configuration parameters and color conversion standard reference data;
the color conversion unit is used for comparing the AD sampling signal transmitted by the signal processing module with the stored color conversion standard reference data and outputting a color detection result.
The invention has the beneficial effects that: the light intensity of a detected object is detected through the control module, the intensity of the detection light source is adjusted in a self-adaptive mode according to the light intensity detection result, red, green and blue light signals collected through the signal sensing module can be in a proper brightness level, color detection processing is carried out on the red, green and blue light signals collected through the signal processing module and the processor module in sequence according to the collected red, green and blue light signals, and finally a color detection result is obtained, so that the accuracy and the intelligent level of the color detection result can be effectively improved.
Detailed Description
The invention is further described in connection with the following application scenarios.
Referring to fig. 1 and 2, the embodiment of the digital intelligent color sensor system includes a processor module 1, a signal sensing module 2, a control module 3 and a signal processing module 4; the processor module 1 is respectively connected with the signal sensing module 2, the control module 3 and the signal processing module 4, and the signal sensing module 2 is connected with the signal processing module 4;
the signal sensing module 2 is used for emitting a detection light source and receiving light signals, wherein the received light signals comprise red light signals, green light signals and blue light signals;
the control module 3 is used for detecting the light intensity of the object to be detected and outputting a corresponding control instruction according to the light intensity detection result to adjust the intensity of the detection light source emitted by the signal sensing module 2;
the signal processing module 4 is used for performing signal processing according to the received optical signal and outputting an AD sampling signal to the processor module 1;
the processor module 1 performs analysis processing according to the received AD sampling signal to obtain a color detection result.
In the above embodiment, a digital intelligent color sensor system is provided, the light intensity of the object to be detected is detected by the control module 3, and the intensity of the detection light source is adaptively adjusted according to the light intensity detection result, so that the red, green and blue three-color light signals collected by the signal sensing module 2 can be at a proper brightness level, and the color detection result is finally obtained by performing color detection processing according to the collected red, green and blue three-color light signals in sequence through the signal processing module 4 and the processor module 1, and the accuracy and the intelligent level of the color detection result can be effectively improved.
In one embodiment, the signal sensing module 2 includes a light source unit 21, an RGB optical signal collection unit 22, and a white light signal collection unit 23; wherein,
the light source unit 21 is for providing a white light source;
the RGB optical signal collecting unit 22 includes a photosensitive collecting unit provided with a red light filtering device, a green light and green light device, and a blue light filtering device, respectively, and is configured to collect a red light signal, a green light signal, and a blue light signal, respectively, and transmit the collected red light signal, green light signal, and blue light signal to the signal processing module 4;
the white light signal collecting unit 23 is configured to directly collect a white light signal reflected by the object to be measured after being irradiated by the white light source, and transmit the collected white light signal to the signal processing module 4.
The light source unit 21 is a white LED lamp, and the illumination intensity of the white LED lamp is adjustable.
In one scenario, the RGB light signal collecting unit 22 may set filtering devices respectively aiming at red light, green light, and blue light on the photosensitive element to respectively collect red light, green light, and blue light signals; the existing three primary color sensors can be adopted to respectively collect red, green and blue light signals.
In one embodiment, the control module 3 includes a light intensity feedback unit 31 and a light source control unit 32;
the light intensity feedback unit 31 is configured to perform light intensity detection according to the received white light signal, and acquire a light intensity detection value;
the light source control unit 32 is configured to perform a determination according to the acquired light intensity detection value, and send a compensation control signal to the light source unit 21 to control the light source unit 21 to adjust the light source brightness to increase when the light intensity detection value is reduced or smaller than a set threshold value.
Meanwhile, when the detected value of the light intensity is increased or greater than the set threshold value, an adjustment control signal is sent to the light source unit 21 to control the light source unit 21 to adjust the brightness of the light source to be decreased.
In one scenario, the light intensity feedback unit 31 may employ an existing illumination intensity detection unit (such as a light intensity sensor), and the illumination intensity detection unit directly detects the light intensity of the object to be detected; or a light intensity detection value is obtained according to the received white light signal.
In one embodiment, an external detection module 5 is further included;
the external detection module 5 is used for being connected with an external detection head, sampling optical signals through the external detection head and transmitting the optical signals sampled through the external detection head to the signal processing module 4;
the processor module 1 comprises a signal selection unit, wherein the signal selection unit is respectively connected with the signal sensing module 2 and the external detection module 5; when detecting that the external detection module 5 is connected with an external detection head, the signal selection unit cuts off the signal sampling of the signal sensing module 2 and selects the external detection head connected with the external detection module 5 for optical signal sampling.
The external detection head can be an optical fiber type detection head;
the processor module 1 detects signal sources (the signal sensing module 2 and the external detection module 5) of optical signals, namely, judges whether an external detection head intervenes, the selection unit selects a detection mode according to the judgment result of the signal sources, and when the external detection head is connected, the external signals are preferentially selected to enter the signal processing module 4 and the processor module 1 for processing.
In one embodiment, the signal processing module 4 includes an AD conversion unit 41, a preprocessing unit 42, and an amplification unit 43 connected in sequence; wherein
The AD conversion unit 41 is configured to perform analog-to-digital conversion on the received optical signal to obtain an AD sampling signal; wherein the received light signals comprise red light signals, green light signals, blue light signals, white light signals transmitted by the signal sensing module 2 or light signals transmitted by the external detection module 5.
The preprocessing unit 42 is configured to perform filtering processing on the acquired AD sampling signal and output a preprocessed AD sampling signal;
the amplifying unit 43 is configured to perform amplification processing on the pre-processed AD sampling signal, and output the AD sampling signal after the amplification processing.
The signal processing module 4 is provided with an AD conversion unit 41 for performing analog-to-digital conversion on the received optical signal to obtain a digital AD sampling signal, and further performing filtering processing and amplification processing on the AD sampling signal; the processor module 1 can be helped to accurately identify each color component value according to the acquired AD sampling signal, thereby acquiring a color detection result.
Meanwhile, the preprocessing unit is arranged to filter the acquired AD sampling signals, noise signal interference in the AD sampling signals can be effectively removed, quality and effect of the AD sampling signals are improved, and color detection processing accuracy based on the AD sampling signals is higher.
In one scenario, the Signal processing module 4 employs a DPS (Digital Signal Processor) chip, and can perform analog-to-Digital conversion on the received optical Signal, and further complete a Digital Signal-based Signal processing process on the converted AD sampling Signal.
In one scenario, the optical signal is specifically a photocurrent signal.
In one scenario, the signal processing module 4 can adjust the amplification factor of the amplifier in the amplifying unit 43, and select different amplification factors according to different detection modes, for example, when detecting objects with weak reflection, such as black, a high amplification factor is selected, and when detecting objects with strong reflection, such as a white light, a low amplification factor is selected.
In one embodiment, the pre-processing unit 42 performs filtering processing on the acquired AD sampling signal, and specifically includes:
performing empirical mode decomposition on the obtained AD sampling signal to obtain an IMF component of the AD sampling signal;
dividing the obtained IMF components into low-frequency IMF components and high-frequency IMF components, and reconstructing according to the low-frequency IMF components to obtain low-frequency signals; reconstructing according to the high-frequency IMF component to obtain a high-frequency signal;
performing wavelet decomposition processing on the low-frequency signal by adopting a set wavelet basis and a set decomposition scale to obtain a high-frequency wavelet coefficient and a low-frequency wavelet coefficient of the low-frequency signal, performing threshold processing on the obtained high-frequency wavelet coefficient, and obtaining a high-frequency wavelet coefficient after the threshold processing;
reconstructing the low-frequency wavelet coefficient and the high-frequency wavelet coefficient after threshold processing to obtain a filtered low-frequency signal;
carrying out weighted median filtering processing on the high-frequency signal to obtain a filtered high-frequency signal;
and reconstructing the filtered low-frequency signal and the filtered high-frequency signal to obtain a preprocessed AD sampling signal.
The preprocessing unit 42 performs high-low frequency division on the obtained IMF component, and specifically includes:
respectively calculating high and low frequency characteristic factors of each IMF component aiming at each obtained IMF component, wherein the adopted high and low frequency characteristic factor calculation function is as follows:
where w (x) represents the high-low frequency characteristic factor of the xth IMF component, x is 2, …, I represents the total number of IMF components, and Z (IMF)
x) Representing the zero-crossing rate, Z (IMF), of the xth IMF component
x-1) Denotes the x-1 IMF scoreA zero-crossing rate of the quantity;
representing an adjustment component obtained from the xth IMF component, wherein
Amplitude, IMF, of the kth sample point representing the conditioning component
x(k) Denotes the amplitude of the kth sample point in the xth IMF component, K ═ 1,2, …, K denotes the total number of sample points, max (IMF)
x(k) Denotes the maximum value of the amplitude of each sample point in the x-th IMF component, beta denotes the adjustment factor, where beta is the [0.03,0.06 ]],
Representing the component of regulation
Zero crossing rate of (2), Z (IMF)
x-1) Indicating the adjustment component obtained from the x-1 th IMF component,
representing the component of regulation
Zero crossing rate of (omega)
1And ω
2Respectively represent weight factors, where
1>ω
2;
Sequentially comparing the acquired high-low frequency characteristic factors of each IMF component with a set threshold value T, and when w (x) is less than T, dividing the (x) th to I) th IMF components into low-frequency IMF components, and dividing the (1) th to (x-1) th IMF components into high-frequency IMF components; if the high-low frequency characteristic factors of the IMF components are smaller than a set threshold value T, the 1 st IMF component is divided into high-frequency IMF components, and the rest IMF components are divided into low-frequency IMF components.
In the above embodiment, for the AD sampling signal obtained based on the optical signal (especially, the AD sampling signal obtained based on the optical signal collected by the optical fiber probe), the high-frequency noise signal is not obvious, so that the conventional denoising filtering technology is easy to have over-processing or poor in processing effect, and for the above problems, a technical scheme for performing high-frequency and low-frequency signal division based on empirical mode decomposition and performing filtering processing on the high-frequency and low-frequency signals respectively is proposed, and a technical scheme for performing high-frequency and low-frequency division based on the IMF component is proposed, so that the high-frequency and low-frequency characteristic factors of each IMF component can be calculated first through the characteristics of the IMF component, wherein the zero-crossing characteristic of the original signal can be obtained under the condition of effectively filtering the noise influence, and further reflecting the high-low frequency characteristics of the IMF component according to the zero-crossing rate characteristics, and adaptively and accurately selecting the division boundary of the high-low frequency signal. Meanwhile, aiming at the divided high-frequency signals, a weighted median filtering processing mode with obvious processing effect is adopted for filtering processing. And aiming at the low-frequency signals reflecting the signal characteristics, the technical scheme based on wavelet decomposition and high-frequency wavelet coefficient threshold processing is further adopted for processing, so that the hidden noise interference in the low-frequency signals can be further removed on the basis of high-frequency and low-frequency division, and the quality of the AD sampling signals is further improved. And a foundation is laid for further amplification and accurate conversion of color component values according to the AD sampling signal.
The preprocessing unit 42 performs thresholding on the obtained high-frequency wavelet coefficients, and specifically adopts a thresholding function as follows:
in the formula, w '(i, j) represents the ith-scale jth high-frequency wavelet coefficient after threshold processing, w (i, j) represents the ith-scale jth high-frequency wavelet coefficient obtained by wavelet decomposition processing, j represents the decomposition scale where w (i, j) is located, alpha represents a set influence factor, b represents a set compensation factor, and T represents a set threshold, wherein w' (i, j) represents the ith-scale jth high-frequency wavelet coefficient after threshold processing, w (i, j) represents the decomposition scale where w (i, j) is located, and T represents
σ represents the noise estimate, and V represents the length of the AD sample signal; sgn (·) denotes a sign function; omega
1And ω
2Respectively, represent the set adjustment weight factors.
In the foregoing embodiment, the threshold processing function is used to perform threshold processing based on the high-frequency wavelet coefficient obtained after the low-frequency signal decomposition, so that the tiny noise included in the high-frequency wavelet coefficient can be invisibly filtered, and thus the low-frequency signal is finely adjusted, and the quality of the AD sampling signal is further improved.
In one embodiment, the processor module 1 comprises a power supply unit, a storage unit, a color conversion unit; wherein
The power supply unit is respectively connected with each module of the system and used for supplying power to each module of the system;
the storage unit is used for storing system configuration parameters and color conversion standard reference data;
the color conversion unit is used for comparing the AD sampling signal transmitted by the signal processing module 4 with the stored color conversion standard reference data and outputting a color detection result.
The color conversion unit receives the red, green and blue light signals and the AD sampling signals after the white light signals are processed respectively, obtains the light intensities of the red, green and blue colors according to the AD sampling signals of the red, green and blue light signals, converts the light intensities into frequency signals according to the light intensity signals, and quantizes R, G, B values, so that a color detection result is obtained;
wherein the light intensity value of the white light signal is compared with the preset white quasi-white light intensity for compensating the quantified R, G, B value according to the comparison result.
In one embodiment, the system further comprises a communication module 6, the communication module 6 being connected to the processor module 1;
the communication module 6 realizes wireless data interaction with an external terminal, and is used for sending the color detection result obtained by the processor module 1 to the external terminal. The communication capacity between the sensor system and an external terminal is improved, and the adaptation level of the sensor system to different scene applications is improved.
It should be noted that, functional units/modules in the embodiments of the present invention may be integrated into one processing unit/module, or each unit/module may exist alone physically, or two or more units/modules are integrated into one unit/module. The integrated units/modules may be implemented in the form of hardware, or may be implemented in the form of software functional units/modules.
From the above description of embodiments, it is clear for a person skilled in the art that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For a hardware implementation, a processor may be implemented in one or more of the following units: an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, other electronic units designed to perform the functions described herein, or a combination thereof. For a software implementation, some or all of the procedures of an embodiment may be performed by a computer program instructing associated hardware. In practice, the program may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. Computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the protection scope of the present invention, although the present invention is described in detail with reference to the preferred embodiments, it should be analyzed by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.