CN110186561B - Firefly flash signal acquisition and reproduction method and device - Google Patents

Firefly flash signal acquisition and reproduction method and device Download PDF

Info

Publication number
CN110186561B
CN110186561B CN201910549866.0A CN201910549866A CN110186561B CN 110186561 B CN110186561 B CN 110186561B CN 201910549866 A CN201910549866 A CN 201910549866A CN 110186561 B CN110186561 B CN 110186561B
Authority
CN
China
Prior art keywords
sample
firefly
fragment
segment
flash signal
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
CN201910549866.0A
Other languages
Chinese (zh)
Other versions
CN110186561A (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.)
Wuhan Tingke Biotechnology Co ltd
Original Assignee
Creative Studio Of Firefly Culture In Hongshan District Of Wuhan City
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 Creative Studio Of Firefly Culture In Hongshan District Of Wuhan City filed Critical Creative Studio Of Firefly Culture In Hongshan District Of Wuhan City
Priority to CN201910549866.0A priority Critical patent/CN110186561B/en
Publication of CN110186561A publication Critical patent/CN110186561A/en
Application granted granted Critical
Publication of CN110186561B publication Critical patent/CN110186561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • G01J2001/4247Photometry, e.g. photographic exposure meter using electric radiation detectors for testing lamps or other light sources

Abstract

The invention is suitable for the technical field of research of firefly flash signals, and provides a firefly flash signal acquisition and reproduction method and a firefly flash signal acquisition and reproduction device.

Description

Firefly flash signal acquisition and reproduction method and device
Technical Field
The invention belongs to the technical field of research on firefly flash signals, and particularly relates to a firefly flash signal acquisition and reproduction method and device.
Background
The communication (interaction) between the fireflies is done by means of a "flashing signal" generated by their light emitters. The 'flashing signals' corresponding to different heteroworms, different behavior stages and different behavior modes are different, and become the communication language of the fireflies. In addition, the communication of certain species of firefly requires both a "flashing signal" and a "pheromone" to work together.
The existing firefly light-emitting simulation scheme is to acquire light-emitting waveform data from a computer through a USB interface and then drive an LED to generate a corresponding flash signal. The disadvantages of this solution are:
firstly, only waveform data from an upper computer can be passively received, a flash signal is simply reproduced, and the device does not have an observation function, namely, a corresponding response cannot be automatically made according to the flash signal of the current living firefly; before use, the upper computer has to edit the light-emitting waveform data, otherwise, the upper computer cannot be used; when in use, the USB interface is needed to be connected with an upper computer, and the USB interface is not provided with a storage function and is inconvenient to carry and use.
And secondly, the recording and collecting capacity of the live firefly flash signals, the firefly pheromone emission function and the luminous intensity fitting function are not provided, and the problem of difference between actual luminous intensity change and live firefly light intensity change exists, so that recurrence distortion is caused.
The existing firefly flash signal acquisition scheme relies on a high-speed infrared camera to record a firefly activity video, then manually watches the video and selects a characteristic segment, and then the pattern recognition software converts the firefly luminous intensity in each frame of image in the segment into data, thereby obtaining continuous luminous data. The disadvantages of this solution are:
the cost is high. The high-speed infrared camera is expensive, and the video storage equipment and the image recognition processing software are expensive.
Loss of detail causes distortion. Since the video taken by the camera has time slots between image frames (the time slot is large, about several tens of milliseconds), that is, there is a time interval between two consecutive image frames of the video. The firefly flash signal variation in this interval is unrecorded, thereby losing detail and causing data distortion. To solve this problem, only a higher speed camera is used to reduce the time slot between image frames. But doing so would result in a substantial increase in cost
Thirdly, manual intervention is needed, and the automation degree is low.
Fourthly, only the firefly flash signal can be recorded passively and cannot interact with the firefly flash signal. That is, it is impossible to record a video of its response to a manually specified strobe signal by stimulating the firefly with the signal.
Disclosure of Invention
In view of the above problems, the present invention provides a method and an apparatus for acquiring and reproducing a firefly flash signal, which aims to solve the technical problems of high cost and poor use effect of the existing firefly flash signal acquisition and light emission simulation.
On one hand, the firefly flash signal acquisition and reproduction method comprises the following steps:
collecting firefly flash signal data and carrying out background light elimination treatment;
extracting effective segments from the flash signal data;
comparing the currently extracted effective fragments with sample fragments in a stored sample library, and judging whether the sample fragments matched with the currently extracted effective fragments exist in the sample library or not through similarity matching calculation;
if the matching sample fragment exists, finding a response fragment corresponding to the current matching sample fragment from a response library according to a mapping table, and then performing light emitting reproduction according to the response fragment;
if the current effective fragment is not stored in the sample library, traversing the sample fragment from the sample library to perform light emitting reproduction, if the collected firefly flash signal data is still the same as the previous flash signal data, determining that the currently selected sample fragment is invalid to the firefly, if the collected firefly flash signal data is changed, determining that the currently selected sample fragment is valid to the firefly, storing the currently selected sample fragment as a new sample fragment into the sample library, simultaneously storing the currently selected sample fragment as a response fragment corresponding to the currently effective fragment into the response library, and updating the mapping table.
Furthermore, if the response library does not have a response segment corresponding to the currently matched sample segment, traversing the sample segment from the sample library to reproduce light emission, if the collected firefly flash signal data is still the same as the previous one, determining that the currently selected sample segment is invalid to the firefly, if the collected firefly flash signal data is changed, determining that the currently selected sample segment is valid to the firefly, storing the currently selected sample segment as the response segment corresponding to the currently matched sample segment to the response library, and updating the mapping table.
Further, the specific process of the background light elimination process is as follows:
collecting data and storing the data into a circulation array, if the data in the circulation array is basically consistent within a continuous period of time, regarding the data as background light environment data, and recording the data as a matrix | A |;
if the acquired data continuously and circularly change, determining that the data in the current circular array is firefly flash signal data and recording as a matrix | B |;
the flash signal data after background light is eliminated is recorded as a matrix | T |, | T | ═ B | - | A |;
taking a maximum element value in the matrix | T | to represent the luminous intensity of the firefly at the current moment;
and storing the obtained luminous intensity in a luminous array according to the acquisition time sequence.
Further, after background light is eliminated, compression processing is carried out, in the luminous array, the first element is luminous intensity obtained by first collection, and the difference value between the subsequent element and the previous element is stored.
Further, the step of extracting effective segments from the flash signal data specifically includes:
sequentially searching the luminous arrays from head to tail, finding out a maximum value a, and calling the element as a maximum value element, wherein the corresponding time point of the element is marked as La;
if the element values of other elements in the luminous array are also a, taking the time point corresponding to one element adjacent to the maximum value element in the elements as Lb;
if the element value of other elements does not exist in the luminous array is equal to a, searching for an element which satisfies that the element value is larger than or equal to a multiplied by an error coefficient and the element corresponding time point-La | > or larger than or equal to a flash change threshold value r from the luminous array, if the searched element is a continuous interval, taking the element with the largest element value in the continuous interval, and marking the corresponding time point as Lb;
and intercepting the elements from La to Lb and storing the elements as a new array, namely the effective segment.
Further, the specific process of the similarity matching calculation is as follows:
recording the intercepted effective fragments as J, and recording the sample fragments in the stored sample library as K1 to Kn in sequence;
for the ith sample fragment, if the length of the sample fragment is the same as that of the effective fragment and is L, calculating the ratio h of J0 to Ki 0;
calculating a waveform similarity distance P;
and if the similarity distance P is smaller than or equal to the similarity threshold, the currently acquired effective fragment is considered to be consistent with the sample fragment Ki, namely the sample fragment Ki is the sample fragment matched with the currently effective fragment J.
Further, if the length of the sample segment is not consistent with the effective segment length, any one of the segments needs to be scaled in time axis equal proportion to keep consistent with the other segment, and then similarity matching calculation is performed.
Further, before gathering firefly flash signal data, still need carry out automatic curve fitting to the LED luminescent plate that is used for the luminescence to reproduce, specific process is as follows:
by PWM pulse width modulation waveform, from duty ratio 0 to duty ratio 100%, stepping is sequentially increased in 1% precision, and the light intensity of the LED light-emitting plate is collected every 1 stepping to obtain a corresponding curve of 'PWM duty ratio and light-emitting intensity';
according to the real luminous intensity recorded by the firefly luminous characteristic sample library, looking up a table to find the LED duty ratio value consistent with the luminous intensity, and automatically converting to obtain the correspondence of 'firefly light intensity-duty ratio', namely completing automatic fitting correction.
On the other hand, firefly flash signal gathers recurrence device includes:
the acquisition processing module is used for acquiring firefly flash signal data and eliminating background light;
the segment extraction module is used for extracting effective segments from the flash signal data;
the matching calculation module is used for comparing the currently extracted effective fragments with the sample fragments in the stored sample library and judging whether the sample fragments matched with the currently extracted effective fragments exist in the sample library or not through similarity matching calculation;
the light-emitting reproduction module is used for finding the response segment corresponding to the current matched sample segment from the response library according to the mapping table if the matched sample segment exists, and then performing light-emitting reproduction according to the response segment; and traversing the sample fragment from the sample library to reproduce the light emission if the matched sample fragment does not exist, determining that the currently selected sample fragment is invalid to the firefly if the collected firefly flash signal data is still the same as the previous flash signal data, determining that the currently selected sample fragment is valid to the firefly if the collected firefly flash signal data is changed, storing the currently selected sample fragment as a new sample fragment into the sample library, simultaneously storing the currently selected sample fragment as a response fragment corresponding to the currently valid fragment into a response library, and updating the mapping table.
Furthermore, the light-emitting reproduction module is further configured to traverse the sample segment from the sample library to perform light-emitting reproduction if the response library does not have a response segment corresponding to the currently matched sample segment, determine that the currently selected sample segment is invalid for fireflies if the collected firefly flash signal data is still the same as before, determine that the currently selected sample segment is valid for fireflies if the collected firefly flash signal data is changed, store the currently selected sample segment as the response segment corresponding to the currently matched sample segment in the response library, and update the mapping table.
The invention has the beneficial effects that: the method comprises the steps of preprocessing acquired data, extracting effective fragments, searching matched sample fragments corresponding to the effective fragments according to a matching algorithm, and then performing luminescence reproduction by adopting a corresponding algorithm, so that the current manual identification and manual interception work can be replaced, and a sample library and a response library can be automatically updated; through the technical scheme, when the firefly emits the flash signal, the flash simulation system can give the corresponding response signal, collect the flash condition of the target living firefly and timely make an attempt and adjustment, so that the flash simulation system can interactively respond with an object through the flash signal like the living firefly, and the display effect of the flash simulation system is far better than that of the existing high-speed camera collection and firefly light-emitting simulation scheme.
Drawings
FIG. 1 is a flowchart of a firefly flash signal acquisition recurrence provided by a first embodiment of the present invention;
FIG. 2 is a diagram illustrating the extraction of valid fragments when there are a plurality of maximum values a in the light emitting array;
FIG. 3 is a schematic diagram of extracting valid segments when there is only one maximum a in the light emitting array;
FIG. 4 is a schematic representation of the full correspondence of the valid segment J and the sample segment K1;
FIG. 5 is a schematic illustration of the effective segment J and the sample segment K1 differing by a certain ratio;
FIG. 6 is a schematic illustration of the inconsistency of the valid segment J with the sample segment K1;
fig. 7 is a block diagram of a firefly flash signal acquisition and reproduction device according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The first embodiment is as follows:
fig. 1 shows a flow of acquisition and reproduction of a firefly flash signal provided by an embodiment of the present invention, and only a part related to the embodiment of the present invention is shown for convenience of description.
The firefly flash signal acquisition and reproduction method provided by the embodiment comprises the following steps:
and step S1, acquiring firefly flash signal data and performing background light elimination processing.
Because fireflies emit light at night, the present invention analyzes the luminescence of a single firefly. The method comprises the steps of firstly collecting the number of firefly flash signals, and shooting by a high-speed infrared camera in the prior art, wherein the cost of the scheme is very high. This embodiment can directly use the photosensor array for signal acquisition. Since the collected data is basically black background light, only the glowworm lighting position is effective data, so the background light needs to be eliminated in the step.
In this embodiment, the background light elimination process is as follows:
s11, collecting data and storing the data into a circulation array, if the data in the circulation array are basically consistent within a continuous period of time, regarding the data as background light environment data, and recording the data as a matrix | A |;
s12, if the collected data continuously and circularly change, determining that the data in the current circular data is firefly flash signal data and recording the data as a matrix | B |;
s13, recording the flash signal data after background light is eliminated as a matrix | T |, | T | ═ B | - | a |;
s14, taking a maximum element value in the matrix | T | to represent the luminous intensity of the firefly at the current moment;
and S15, storing the obtained luminous intensity in a luminous array according to the acquisition time sequence.
The collected data is the data obtained by starting optical signal sampling after the system is powered on and establishing a multidimensional cyclic array for the m multiplied by n photosensitive elements to store and collect. The processing algorithm aims to eliminate background light, obtain the light intensity change data of the living firefly and effectively compress the data storage capacity. Because the glowworm lighting is continuously changed in intensity, if the data in the cyclic array are basically consistent in a continuous period of time, the data are regarded as background light environment data and are recorded as a matrix | A |. If there is firefly activity (flare), the matrix | B | acquired by m × n photosensors is necessarily different from | A |. Then the effective flash signal matrix | T | B | - | a |, and the matrix | P | obtained at this time is the lighting data sampling matrix after the background light environment is eliminated.
In order to obtain accurate luminescence data for research and experiment, the present embodiment performs observation sampling for 1 live firefly, i.e., the data in the | T | matrix contains only the flash information of 1 firefly, and the rest are invalid data. Then for each sampling conversion period, 1 matrix | T | is obtained, and a maximum element value in the | T | matrix, which represents the luminous intensity of the firefly at the current time, is taken. Then the matrix | T | is reduced from m × n elements to one element q at this time. The elements are stored as 1 array in the order of sampling time, and an effective array of the sampled data is obtained, which is called as a luminous array here.
In addition, as a specific example, the present embodiment uses an STM32F series microcontroller as a control center chip, and the integrated AD conversion precision of the microcontroller is 12 bits, that is, one AD sample data value needs to occupy 2 bytes. In order to reduce the memory capacity requirement of data storage, in this embodiment, the data after background light is eliminated may be further compressed, and first, the q value obtained by the first acquisition is separately stored as an initial value, and occupies 2 bytes, and if the length of the sampling data array is M, 2 × M bytes are required to store the data. Then the subsequent element is the current element value-the previous element value, and the saving delta takes 1 byte.
Because the luminescence of the firefly is gradual, the sampling speed of the invention is high (the interval time is short), and the difference value of the light intensity change of the firefly is not large when two adjacent samplings are carried out, and 1 byte is enough for storage. The compressed array memory space is 1 xm +2 bytes, which reduces the memory capacity by about 50%.
Step S2, extracting valid segments from the flash signal data.
Valid segments refer to non-repeating luminous data segments. Live firefly lighting is a varying light signal and repeats itself cyclically, thus causing multiple repetitive segments to exist within the lighting data set. The extraction refers to a process of finding a repeated data segment in an obtained light emitting array, and intercepting and storing a segment of the data segment as an effective segment. The specific process for extracting the effective fragments is as follows:
and S21, sequentially searching the luminous arrays from head to tail, finding the maximum value a, and calling the element as the maximum value element, wherein the corresponding time point is marked as La.
S22, if the value of the element of the other element in the light emitting array is also a, the time point corresponding to one of the elements adjacent to the maximum value element is denoted as Lb.
As shown in fig. 2, the light emitting arrays are sequentially searched from beginning to end to find a maximum value a, and the time point corresponding to the element is denoted as La. If there is another element value a in the light-emitting array, the element whose | time point — La | is the minimum value is denoted as Lb, that is, the element closest to La and the element value is a.
And S23, if the element value of other elements does not exist in the luminous array is equal to a, searching for an element which satisfies the condition that the element value is larger than or equal to a multiplied by error coefficient and the element corresponding time point-La | > or equal to the flash change threshold value r from the luminous array, and if the searched element is a continuous interval, taking the element with the largest element value in the continuous interval and marking the corresponding time point as Lb.
And S24, intercepting the elements between La and Lb and storing the elements as a new array, namely the effective segment.
As shown in fig. 3, assuming that the element value at La is equal to a, and no other element value is present in the light emitting array, then the light emitting array is searched for a light emitting array that satisfies the condition: the element value is larger than or equal to a multiplied by the error coefficient, and the element corresponds to the time point-La | > or equal to the element of the flash change threshold value r.
The intensity of light at Lb is La x error factor, and the time at Lb > La + r
If a plurality of continuous points near Lb simultaneously satisfy the light intensity multiplied by the error coefficient at the position of being more than or equal to La, the maximum value is searched in the continuous interval, and the foot mark of the maximum value is taken as Lb.
And intercepting and storing all elements from La to Lb in the luminous array as a new array J, wherein the array J is the effective segment, the rest data (namely from the number 0 to La, and from Lb to the array tail) belong to redundant data, automatically eliminating the redundant data to save the storage space, and only storing the intercepted array J.
And step S3, comparing the currently extracted effective fragments with the sample fragments in the stored sample library, and judging whether the sample fragment matched with the currently extracted effective fragment exists in the sample library through similarity matching calculation.
Similarity matching refers to a process of comparing a currently acquired valid fragment (considered as unknown) with a stored sample fragment (considered as known) to obtain whether the "unknown fragment" is equal to the "known fragment".
A plurality of sample fragments have been stored in the sample library, and the fragment data is basic fragment data which is previously entered by a researcher. The similarity matching calculation process is as follows:
s31, recording the intercepted effective fragments as J, and recording the sample fragments in the stored sample library as K1 to Kn in sequence;
s32, for the ith sample fragment, if the length of the sample fragment is the same as that of the valid fragment and is L, calculating the ratio h of J [0] to Ki [0], namely the difference ratio of the first elements (large values) in the two arrays. Wherein J0 is the value of the first element in the effective segment J, and Ki 0 is the value of the first element in the ith sample segment Ki.
S33, calculating the waveform similarity distance
Figure GDA0002906528140000091
And S34, if the similarity distance P is smaller than or equal to the similarity threshold, the currently acquired effective fragment is considered to be consistent with the sample fragment Ki, namely the sample fragment Ki is the sample fragment matched with the currently acquired effective fragment J, otherwise, the sample fragment Ki is not consistent with the sample fragment matched with the currently acquired effective fragment J.
The object calculated in this step is the array J after the extraction of the valid segment, that is, the redundant data is not included, and the light-emitting characteristic periods are aligned (characteristic alignment: in different arrays J, the peak value of the light-emitting intensity is the first element of the array).
As shown in fig. 4, the effective segment J and the sample segment K1 completely coincide with each other, and the waveform similarity distance P is 0, and both coincide with each other.
As shown in fig. 5, the difference between the effective segment J and the sample segment K1 is a certain ratio, and the waveform similarity distance P after the ratio correction approaches 0, and the two are consistent.
As shown in fig. 6, the effective segment J and the sample segment K1 are not consistent, and the waveform similarity distance P is significantly larger, so that the two do not match.
If the length of the sample segment is not consistent with the effective segment length, any one of the segments needs to be subjected to time axis equal scaling so as to keep consistent with the other segment, and then similarity matching calculation is carried out.
And step S4, if the current matching sample fragment exists, finding the corresponding response fragment from the response library according to the mapping table, and then performing light emitting reproduction according to the response fragment.
If the sample fragment matched with the current effective fragment exists in the sample library, the currently acquired effective fragment data is considered to exist in the system, repeated storage is not needed, and the currently acquired firefly lighting behavior can be known.
The mapping table stores the corresponding relationship between the response segment and the sample segment, that is, when the lighting behavior of the firefly is collected at present, the corresponding flash signal is adopted for response, because some specific behavior actions of the firefly corresponding to the flash information are known through some series of researches and stored in the form of the sample segment, some response segments corresponding to specific sample segments can be set, and the corresponding relationship is stored by the mapping table. In the step, after the response segment corresponding to the matched sample segment is found, the light emitting recurrence is directly carried out, and the light emitting recurrence is exhibited in an LED plate form, so that the LED plate can be controlled to carry out control on light emitting intensity and light emitting time according to the content of the response segment.
In this step, if there is a matched sample segment, but the sample in the sample library may be updated at any time, for example, the researchers find a new flash signal feature, and at this time, there is no corresponding response segment in the response library, at this time, the sample segment is traversed from the sample library to perform a light emission recurrence, if the collected firefly flash signal data is still the same as before, the currently selected sample segment is determined to be invalid for the firefly, if the collected firefly flash signal data is changed, the currently selected sample segment is determined to be valid for the firefly, the currently selected sample segment is stored as the response segment corresponding to the currently matched sample segment in the response library, and the mapping table is updated. Therefore, the response library can be updated by itself, and the fragments and the corresponding relation in the sample library and the response library are more and more perfect as time goes on.
Step S5, if the current sample fragment does not exist, traversing the sample fragment from the sample library to perform light emitting reproduction, if the collected firefly flash signal data is still the same as the previous data, determining that the currently selected sample fragment is invalid for the firefly, if the collected firefly flash signal data changes, determining that the currently selected sample fragment is valid for the firefly, storing the currently selected sample fragment as a new sample fragment into the sample library, meanwhile, storing the currently selected sample fragment as a response fragment corresponding to the currently valid fragment into a response library, and updating the mapping table.
In addition, since the characteristic curves of the light emitting intensity and the duty ratio of the LED light emitting diodes (different batches and different powers) are not consistent, the characteristic curve of the light emitting intensity of the LED light emitting diodes themselves is also inconsistent with the characteristic curve of the light emitting intensity of the living firefly. If the fitting correction processing is not added, the problem of recurrent distortion is caused. Therefore, before the collection starts, the automatic curve fitting of the LED light emitting panel is required, and the specific process is as follows:
by PWM pulse width modulation waveform, from duty ratio 0 to duty ratio 100%, stepping is sequentially increased according to 1% precision, and the light intensity of the LED light-emitting plate is collected every 1 stepping to obtain a corresponding curve (which can generate a data table) of 'PWM duty ratio and light-emitting intensity';
according to the real luminous intensity recorded by the firefly luminous characteristic sample library, looking up a table to find the LED duty ratio value consistent with the luminous intensity, and automatically converting to obtain a correspondence (data table or curve) of 'firefly light intensity-duty ratio', namely completing automatic fitting correction.
Example two:
the embodiment provides a firefly flash signal gathers recurrence device, as shown in fig. 7, the device includes:
the acquisition processing module 101 is used for acquiring firefly flash signal data and performing background light elimination processing;
a segment extraction module 102, configured to extract valid segments from the flash signal data;
the matching calculation module 103 is used for comparing the currently extracted effective fragments with the sample fragments in the stored sample library, and judging whether the sample fragments matched with the currently extracted effective fragments exist in the sample library through similarity matching calculation;
a light emitting reproduction module 104, configured to find a response segment corresponding to the currently matched sample segment from the response library according to the mapping table if the matched sample segment exists, and then perform light emitting reproduction according to the response segment; and traversing the sample fragment from the sample library to reproduce the light emission if the matched sample fragment does not exist, determining that the currently selected sample fragment is invalid to the firefly if the collected firefly flash signal data is still the same as the previous flash signal data, determining that the currently selected sample fragment is valid to the firefly if the collected firefly flash signal data is changed, storing the currently selected sample fragment as a new sample fragment into the sample library, simultaneously storing the currently selected sample fragment as a response fragment corresponding to the currently valid fragment into a response library, and updating the mapping table.
The light emitting and reproducing module 104 is further configured to traverse the sample segment from the sample library to perform light emitting and reproducing if the response library does not have a response segment corresponding to the currently matched sample segment, determine that the currently selected sample segment is invalid for fireflies if the collected firefly flash signal data is still the same as the previous one, determine that the currently selected sample segment is valid for fireflies if the collected firefly flash signal data is changed, store the currently selected sample segment as the response segment corresponding to the currently matched sample segment in the response library, and update the mapping table.
The above functional modules correspondingly realize the steps in the first embodiment, flash signals are collected through the collection processing module, background light processing is eliminated, data compression can be further performed, effective fragments are extracted through the fragment extraction module, whether a sample fragment matched with the current effective fragment exists in the sample library or not is calculated through the matching calculation module, finally the light-emitting reproduction module performs light-emitting reproduction according to matching conditions and whether a corresponding response fragment exists in the response library or not, the sample library, the response library and the mapping table are updated in time, and fragment data in the sample library and the response library are more and more abundant in time, so that the flash signal change and information interaction of fireflies better, and the experience effect is better.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A firefly flash signal acquisition and reproduction method is characterized by comprising the following steps:
collecting firefly flash signal data and carrying out background light elimination treatment;
extracting effective segments from the flash signal data;
comparing the currently extracted effective fragments with sample fragments in a stored sample library, and judging whether the sample fragments matched with the currently extracted effective fragments exist in the sample library or not through similarity matching calculation;
if the matching sample fragment exists, finding a response fragment corresponding to the current matching sample fragment from a response library according to a mapping table, and then performing light emitting reproduction according to the response fragment;
if the current effective fragment is not stored in the sample library, traversing the sample fragment from the sample library to perform light emitting reproduction, if the collected firefly flash signal data is still the same as the previous flash signal data, determining that the currently selected sample fragment is invalid to the firefly, if the collected firefly flash signal data is changed, determining that the currently selected sample fragment is valid to the firefly, storing the currently selected sample fragment as a new sample fragment into the sample library, simultaneously storing the currently selected sample fragment as a response fragment corresponding to the currently effective fragment into the response library, and updating the mapping table.
2. The firefly flash signal acquisition and reproduction method of claim 1, wherein if the response library does not have a response segment corresponding to the currently matched sample segment, the sample segment is traversed from the sample library for light emission reproduction, if the acquired firefly flash signal data is still the same as before, the currently selected sample segment is determined to be invalid for fireflies, if the acquired firefly flash signal data is changed, the currently selected sample segment is determined to be valid for fireflies, the currently selected sample segment is stored as a response segment corresponding to the currently matched sample segment in the response library, and the mapping table is updated.
3. A firefly flash signal acquisition and reproduction method according to claim 2, wherein the background light elimination process is as follows:
collecting data and storing the data into a circulation array, if the data in the circulation array is basically consistent within a continuous period of time, regarding the data as background light environment data, and recording the data as a matrix | A |;
if the acquired data continuously and circularly change, determining that the data in the current circular array is firefly flash signal data and recording as a matrix | B |;
the flash signal data after background light is eliminated is recorded as a matrix | T |, | T | ═ B | - | A |;
taking a maximum element value in the matrix | T | to represent the luminous intensity of the firefly at the current moment;
and storing the obtained luminous intensity in a luminous array according to the acquisition time sequence.
4. A firefly flash signal acquisition and reproduction process according to claim 3, wherein a compression process is further performed after background light is removed, and in the luminous array, the first element is the luminous intensity obtained by the first acquisition, and the subsequent elements are stored as differences from the previous element.
5. A firefly flash signal acquisition and reproduction method according to claim 3 or 4, wherein the step of extracting valid segments from flash signal data includes the following steps:
sequentially searching the luminous arrays from head to tail, finding out a maximum value a, and calling the element as a maximum value element, wherein the corresponding time point of the element is marked as La;
if the element values of other elements in the luminous array are also a, taking the time point corresponding to one element adjacent to the maximum value element in the elements as Lb;
if the element value of other elements does not exist in the luminous array is equal to a, searching for an element which satisfies that the element value is larger than or equal to a multiplied by an error coefficient and the element corresponding time point-La | > or larger than or equal to a flash change threshold value r from the luminous array, if the searched element is a continuous interval, taking the element with the largest element value in the continuous interval, and marking the corresponding time point as Lb;
and intercepting the elements from La to Lb and storing the elements as a new array, namely the effective segment.
6. The firefly flash signal acquisition and reproduction method according to claim 5, wherein the similarity matching calculation is performed by the following specific process:
recording the intercepted effective fragments as J, and recording the sample fragments in the stored sample library as K1 to Kn in sequence;
aiming at the ith sample fragment, if the lengths of the sample fragment and the valid fragment are the same and are both L, calculating the ratio h of J0 to Ki 0, wherein J0 is the numerical value of the first element in the valid fragment J, and Ki 0 is the numerical value of the first element in the ith sample fragment Ki;
calculating the waveform similarity distance
Figure FDA0002906528130000021
Wherein L is the length of the valid fragment and the sample fragment;
and if the similarity distance P is smaller than or equal to the similarity threshold, the currently acquired effective fragment is considered to be consistent with the sample fragment Ki, namely the sample fragment Ki is the sample fragment matched with the currently effective fragment J.
7. The firefly flash signal acquisition and reproduction method of claim 6, wherein if the length of the sample segment does not coincide with the effective segment length, any one of the segments is time-axis-scaled to keep the same as the other segment, and then similarity matching calculation is performed.
8. The firefly flash signal acquisition and reproduction method of claim 7, wherein before the firefly flash signal data is acquired, an automatic curve fitting is further performed on the LED light-emitting panel for light emission reproduction, which comprises the following specific steps:
by PWM pulse width modulation waveform, from duty ratio 0 to duty ratio 100%, stepping is sequentially increased in 1% precision, and the light intensity of the LED light-emitting plate is collected every 1 stepping to obtain a corresponding curve of 'PWM duty ratio and light-emitting intensity';
according to the real luminous intensity recorded by the firefly luminous characteristic sample library, looking up a table to find the LED duty ratio value consistent with the luminous intensity, and automatically converting to obtain the correspondence of 'firefly light intensity-duty ratio', namely completing automatic fitting correction.
9. A firefly flash signal acquisition and reproduction device, characterized in that the device includes:
the acquisition processing module is used for acquiring firefly flash signal data and eliminating background light;
the segment extraction module is used for extracting effective segments from the flash signal data;
the matching calculation module is used for comparing the currently extracted effective fragments with the sample fragments in the stored sample library and judging whether the sample fragments matched with the currently extracted effective fragments exist in the sample library or not through similarity matching calculation;
the light-emitting reproduction module is used for finding the response segment corresponding to the current matched sample segment from the response library according to the mapping table if the matched sample segment exists, and then performing light-emitting reproduction according to the response segment; and traversing the sample fragment from the sample library to reproduce the light emission if the matched sample fragment does not exist, determining that the currently selected sample fragment is invalid to the firefly if the collected firefly flash signal data is still the same as the previous flash signal data, determining that the currently selected sample fragment is valid to the firefly if the collected firefly flash signal data is changed, storing the currently selected sample fragment as a new sample fragment into the sample library, simultaneously storing the currently selected sample fragment as a response fragment corresponding to the currently valid fragment into a response library, and updating the mapping table.
10. The firefly flash signal acquisition and reproduction device of claim 9, wherein the light emission reproduction module is further configured to traverse the sample segment from the sample library for light emission reproduction if the response library does not have a response segment corresponding to the currently matching sample segment, determine that the currently selected sample segment is invalid for fireflies if the acquired firefly flash signal data is still the same as before, determine that the currently selected sample segment is valid for fireflies if the acquired firefly flash signal data changes, store the currently selected sample segment as the response segment corresponding to the currently matching sample segment in the response library, and update the mapping table.
CN201910549866.0A 2019-06-24 2019-06-24 Firefly flash signal acquisition and reproduction method and device Active CN110186561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910549866.0A CN110186561B (en) 2019-06-24 2019-06-24 Firefly flash signal acquisition and reproduction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910549866.0A CN110186561B (en) 2019-06-24 2019-06-24 Firefly flash signal acquisition and reproduction method and device

Publications (2)

Publication Number Publication Date
CN110186561A CN110186561A (en) 2019-08-30
CN110186561B true CN110186561B (en) 2021-03-16

Family

ID=67722968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910549866.0A Active CN110186561B (en) 2019-06-24 2019-06-24 Firefly flash signal acquisition and reproduction method and device

Country Status (1)

Country Link
CN (1) CN110186561B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001006410A (en) * 1999-06-21 2001-01-12 Dowa Mining Co Ltd Reproducing method for light of firefly and its device
US8928227B2 (en) * 2009-08-23 2015-01-06 Thomas John Padula Light emitting bio-mimicry device
CN103411136B (en) * 2013-07-18 2015-08-05 江苏大学 A kind of artificial cold light lamp of simulating fire fly luminescence principle
CN104678968A (en) * 2015-02-10 2015-06-03 中国科学院西安光学精密机械研究所 Fireworm luminous simulator

Also Published As

Publication number Publication date
CN110186561A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
Liang et al. A visual detection method for nighttime litchi fruits and fruiting stems
US6587637B2 (en) Image retrieving method and apparatuses therefor
CN107704878B (en) Hyperspectral database semi-automatic establishment method based on deep learning
JP2005517278A5 (en)
CN110186561B (en) Firefly flash signal acquisition and reproduction method and device
JP4146955B2 (en) Image processing method and image processing apparatus
CN107623969A (en) A kind of road lamp system with tracking function
CN109936713B (en) Method and apparatus for decoding information conveyed by a light source
CN1916939A (en) Image retrieval method and apparatus independent of illumination change
CN113965259A (en) Single-base-station integrated communication and positioning integrated system based on visible light wireless transmission
CN107493641B (en) Light control method and device driven by music
CN109460686A (en) A kind of method and system aiming at light blanking for sighting device
CN1351305A (en) Intelligent monitor system and method for grain insects in grain depot
CN115802557A (en) Lamp effect control method, device, product, medium and lamp effect control equipment
CN114124220B (en) Intelligent terminal visible light wireless communication method
CN103108151A (en) Video monitoring method and video monitoring system
CN115937943A (en) Robot vision system based on emotion calculation
CN115171151A (en) Pig drinking behavior detection method based on pig face recognition
CN106097293B (en) A kind of image severability evaluation method for image capturing system optimization design
CN201155944Y (en) Ball firing system
CN109597030B (en) Method and device for positioning objects in storage room based on visible light signals
CN112272050B (en) MIMO optical wireless communication system based on image acquisition and communication processing method thereof
CN220088354U (en) Sustainable orchard pest trapping, identifying and counting device
CN113922875B (en) Visible light single-base-station integrated communication positioning integrated system based on deep learning
CN110706216A (en) AI intelligent recognition-based tumor immune microenvironment data rapid processing system

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231114

Address after: 430000 No. 43, Baiquan maomiaoji street, Dongxihu District, Wuhan City, Hubei Province

Patentee after: Wuhan tingke Biotechnology Co.,Ltd.

Address before: 430071 room 4, 6 / F, building 17-7, block 17, Vanke Golden City, Zhangjiawan, Hongshan District, Wuhan City, Hubei Province

Patentee before: Creative Studio of Firefly Culture in Hongshan District of Wuhan City