Disclosure of Invention
The invention provides a method for measuring liquid concentration based on calculation and focus finding, which solves one or more technical problems in the prior art and at least provides a beneficial selection or creation condition.
The invention provides a liquid concentration measuring method based on calculation focus finding, which adopts a liquid concentration auxiliary measuring device comprising a laser generator, a plano-concave lens, an auxiliary focus finding device, an aperture diaphragm and a CCD camera, and comprises the following steps:
When the plano-concave lens is filled with liquid to be measured, the laser generator is controlled to generate parallel laser beams, the parallel laser beams penetrate through the liquid to be measured and then generate emergent divergence change through the plano-concave lens, and the generated divergent beams are projected to a photosurface of the CCD camera through the auxiliary focus finding device and the aperture diaphragm;
Controlling the CCD camera to be fixed on a defocused plane and carrying out imaging processing on the collected optical signals to obtain an image to be detected corresponding to the liquid to be detected;
analyzing the image to be detected to obtain the size of the light spot to be detected;
and calling a fitting relation between the liquid concentration and the light spot size, substituting the light spot size to be measured into the fitting relation for calculation, and obtaining the concentration of the liquid to be measured.
Further, the auxiliary focus finding device is a convex lens, the divergent light beams are converged by the convex lens, and the generated converged light beams enter the CCD camera after being intercepted by the middle part of the aperture diaphragm.
Further, the diameter of the convex lens is the same as the clear aperture of the plano-concave lens, the focal length of the convex lens is related to the focal length change range of the plano-concave lens after liquid filling and the arrangement interval between the convex lens and the plano-concave lens, and the arrangement interval between the aperture diaphragm and the CCD camera is 10mm.
Further, the CCD camera is arranged in front of the minimum total focal length formed by combining the plano-concave lens and the convex lens after liquid filling.
Further, the CCD camera is arranged behind the maximum total focal length formed by combining the plano-concave lens and the convex lens after liquid filling.
Further, the analyzing the image to be measured to obtain the size of the light spot to be measured includes:
The image to be measured is a facula original image, and records focus information of the plano-concave lens after liquid filling on a defocusing plane;
performing binarization processing on the image to be detected to obtain a binarized image;
and segmenting a light spot fitting image from the binarized image, acquiring the pixel area occupied by the light spot fitting image in the binarized image, and outputting the pixel area as the size of the light spot to be detected.
Further, the auxiliary focus finding device is a thin scattering medium, the divergent light beam penetrates through the thin scattering medium to form a space-distributed speckle signal, and the light beam carrying the speckle signal enters the CCD camera after being intercepted by the middle part of the aperture diaphragm.
Further, a layout interval between the Bao Sanshe medium and the plano-concave lens is 10mm, a layout interval between the CCD camera and the thin scattering medium is 10mm, and a layout interval between the aperture diaphragm and the thin scattering medium is 3mm.
Further, the analyzing the image to be measured to obtain the size of the light spot to be measured includes:
the image to be detected is a speckle original image, and speckle granule information presented on a defocused plane by the plano-concave lens after liquid filling is recorded;
Processing the image to be detected based on a speckle autocorrelation imaging principle to obtain a spot image to be detected;
performing binarization processing on the light spot image to be detected to obtain a binarized image;
and segmenting a light spot fitting image from the binarized image, acquiring the pixel area occupied by the light spot fitting image in the binarized image, and outputting the pixel area as the size of the light spot to be detected.
Further, the fitting relation is obtained by:
Obtaining a plurality of liquid samples with different known concentrations, wherein the types of the liquid samples are the same as the types of the liquid to be detected;
For each liquid sample, performing imaging processing on the liquid sample for multiple times by using the liquid concentration auxiliary measuring device to obtain a plurality of image samples corresponding to the liquid sample;
analyzing the plurality of image samples to obtain a plurality of spot sizes;
Averaging the plurality of light spot sizes to obtain an average light spot size corresponding to the liquid sample;
and when the measurement of the plurality of liquid samples is completed, performing curve fitting on the concentrations and the average light spot sizes corresponding to the plurality of liquid samples to obtain a fitting relation between the liquid concentration and the light spot sizes.
The invention has the advantages that the auxiliary measuring device for the liquid concentration is quickly built by utilizing common optical equipment in an optical laboratory, the integration level is high, the operation difficulty is low, a small amount of liquid samples of various types can be directly measured in a non-contact mode, pretreatment before experiments on the liquid samples is not needed, the practicability is good, the key parameters are obtained by introducing a machine vision technology to process images output by the device, and the key parameters are calculated by calling a fitting relation with reliable verification to obtain the required measuring data, so that the measuring accuracy and the reliability can be improved.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It should be noted that although functional block diagrams are depicted as block diagrams, and logical sequences are shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the block diagrams in the system. The terms "first," "second," "third," "fourth," and the like in the description of the application and in the above-described figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order, and it should be understood that the data so used may be interchanged, as appropriate, in order that the embodiments of the application described herein may be practiced in other than those illustrated or described. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an auxiliary measuring device for liquid concentration in an embodiment of the invention, where the device includes a laser generator 110, a plano-concave lens 120, an auxiliary focusing device 130, an aperture diaphragm 140, and a CCD (Charge Coupled Device ) camera 150.
In a specific implementation process, when the plano-concave lens 120 is filled with a liquid sample, the liquid sample should have a certain absorption capacity and scattering capacity, the laser generator 110 is configured to generate a parallel laser beam, the plano-concave lens 120 after filling is configured to diverge the parallel laser beam passing through the liquid sample and treat the parallel laser beam as a diverging beam with a virtual focus, the virtual focus is materialized with the assistance of the auxiliary focus-seeking device 130 and the aperture diaphragm 140 and is emitted to a light sensing surface of the CCD camera 150 in another form, and the CCD camera 150 is fixed on an off-focus plane for performing an imaging process on the collected optical signal, where the aperture diaphragm 140 can be understood as a function of approximating an optical path formed by a plane wave beam into a geometric projection through an aperture.
In the embodiment of the present invention, the laser generator 110 preferably adopts a gaussian beam emitter, and when the laser generator is put into use, the corresponding laser power is set to 8mW, no matter how deep the liquid sample is, as long as the liquid sample has a certain transparency, even if the liquid sample is turbid and the liquid surface is uneven due to the generation of small bubbles and small waves, the laser beam with strong coherence and high power still has high penetrating power.
In the embodiment of the present invention, the plano-concave lens 120 is preferably a K9 plano-concave lens with a diameter of 20mm and a focal length of-40 mm, which allows a maximum of 1ml of liquid sample to be loaded, and when the refractive indexes of the liquid samples loaded onto the plano-concave lens 120 are different, the parallel laser beam enters the plano-concave lens 120 through the liquid sample, so that the focal length of the plano-concave lens 120 after being loaded with liquid is changed.
In the practical application process, when the plano-concave lens 120 is filled with the liquid sample, the liquid surface is approximately formed into a small convex lens due to the surface tension of the liquid sample, so that the incident light is scattered and reflected unnecessarily, the measurement stability of the liquid sample is affected, the glass sheet 121 needs to be placed on the top of the plano-concave lens 120, a sealed space is provided for the liquid sample, the surface unevenness is eliminated, the influence of vibration on the liquid is reduced, and the volatilization of the liquid can be reduced in some cases.
Of course, there are biconcave lenses with similar functions on the market, and the advantages of filling the plano-concave lens 120 to assist in measuring the concentration of the liquid according to the present invention are described below:
referring to fig. 2 (a), the total focal length of the filled plano-concave lens 120 is:
in the formula, To the total focal length of the filled plano-concave lens 120,Is the focal length of the non-filled plano-concave lens 120,For the refractive index of the glass sheet placed on top of the plano-concave lens 120, a specific value is 1.5163,The refractive index of the liquid sample is the refractive index of the liquid sample, and the concentration of the liquid sample has a certain conversion relation with the refractive index of the liquid sample;
Referring to fig. 2 (b), the total focal length of the biconcave lens after filling is:
in the formula, To be the total focal length of the biconcave lens after filling,Is the focal length of the biconcave lens without liquid,The refractive index of the glass sheet placed on top of the biconcave lens is also 1.5163;
from the above two formulas, it is assumed that the focal length of the plano-concave lens 120 is not filled with liquid Focal length of biconcave lens without liquidAt the same time, the total focal length of the plano-concave lens 120 after liquid fillingTotal focal length of biconcave lens after fillingLarger, i.e. the use of the plano-concave lens 120 allows for a smaller depth of focus, a more accurate position of the focal point in the out-of-focus plane, resulting in a more accurate measurement, and when the refractive index of the liquid sample isWhen a minute change (which is understood to be 0.001), the total focal length of the plano-concave lens 120 after liquid filling is calculatedThe change is larger, and compared with the biconcave lens after filling, the refractive index change of the liquid sample is reflected more easily, that is, the plano-concave lens 120 can enable the measurement result to have better sensitivity.
In a preferred embodiment, the auxiliary focus device 130 in the auxiliary liquid concentration measuring apparatus shown in fig. 1 is described as an example.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating another structure of an auxiliary measuring device for liquid concentration according to an embodiment of the present invention, where the device includes a laser generator 110, a plano-concave lens 120, a convex lens 131, an aperture stop 140, and a CCD camera 150, the convex lens 131 is the auxiliary focus searching device 130, a point a represents a focal position that is assumed when the plano-concave lens 120 is loaded with a liquid sample with a refractive index of n1, and a point B represents a focal position that is assumed when the plano-concave lens 120 is loaded with a liquid sample with a refractive index of n2, where n1+.n2.
In a specific implementation process, when the plano-concave lens 120 is filled with a liquid sample, the laser generator 110 is configured to generate a parallel laser beam, the plano-concave lens 120 after filling is configured to diverge the parallel laser beam passing through the liquid sample and treat the parallel laser beam as a virtual focus outgoing divergent beam, the convex lens 131 is configured to converge the divergent beam and generate a converging beam, the aperture stop 140 is configured to intercept a middle portion of the converging beam and then transmit the converging beam to the CCD camera 150, and the CCD camera 150 is fixed on an out-of-focus plane for performing an imaging process on the collected optical signal.
In this preferred embodiment, the minimum arrangement distance between the plano-concave lens 120 and the convex lens 131 is set to be 5mm, the minimum arrangement distance between the aperture stop 140 and the CCD camera 150 is set to be 10mm, the convex lens 131 may be a biconvex lens with a diameter of 20mm and a focal length of 100mm, or a biconvex lens with a diameter of 20mm and a focal length of 150mm, and the focal length of the convex lens 131 is selected as follows:
the total focal length formed by combining the plano-concave lens 120 and the convex lens 131 after filling is:
in the formula, For the total focal length formed by the combination of the plano-concave lens 120 and the convex lens 131 after filling,As the focal length of the convex lens 131,A minimum arrangement pitch between the plano-concave lens 120 and the convex lens 131;
from the above formula, when In this case, the combined focal length between the plano-concave lens 120 and the convex lens 131 after fillingThe maximum value can be obtained to minimize the focal depth, thereby improving the accuracy of the final measurement result, and the focal length of the plano-concave lens 120 after liquid filling is known through a preliminary testVarying within the range of-117 mm, -140mm, combining the formulasThe calculation result shows that the method comprises the steps of,It should be close to the range of [121mm,145mm ], since the focal length of each of the commercial lenticular lenses is substantially a multiple of 50mm, the present invention selects a lenticular lens having a focal length of 100mm or 150 mm.
In this preferred embodiment, the CCD camera 150 should be disposed in front of the minimum total focal length formed by combining the plano-concave lens 120 and the convex lens 131 after filling, so that the focal length monotonous variation of the plano-concave lens 120 after filling can be included in the range of unidirectional variation of the light spot shot by the CCD camera 150, and the integration level of the whole device is improved.
In addition, the layout position is determined by calibrating the CCD camera 150 in advance, in a specific embodiment, when the concentration of the liquid sample is larger, the refractive index of the liquid sample is larger, and the liquid sample is placed on the plano-concave lens 120 for measurement, the total focal length formed by combining the plano-concave lens 120 and the convex lens 131 after liquid filling is smaller, so that according to the type of the liquid sample which is finally required to be tested, the liquid sample with the highest known concentration is selected and loaded on the plano-concave lens 120, the laser generator 110 and the CCD camera 150 are started for calibration experiments, and the distance between the CCD camera 150 and the convex lens 131 is shortened by continuously adjusting so that the light spot size can be enlarged to be basically distributed on the collecting screen of the CCD camera 150, and then the CCD camera 150 is fixed at the current position.
Of course, the CCD camera 150 may be disposed behind the maximum total focal length formed by combining the plano-concave lens 120 and the convex lens 131 after filling, without considering the problem of integration of the whole device, and the present invention is not limited thereto.
The reason why the image data obtained after the imaging process by the CCD camera 150 actually describes the distribution information of the geometrical projection of the focal spot onto the defocus plane, not the focal spot information, is not the image data directly describing the focal spot information, is as follows:
after the aperture diaphragm 140 limits the light beam range, the plano-concave lens 120 and the convex lens 131 after liquid filling can effectively focus light into a small area in a short distance under the cooperation of the two, obvious fraunhofer diffraction phenomenon exists, and an Airy spot is formed near the focal point, wherein the radius formula is as follows:
in the formula, Is the radius of the airy disk,For the wavelength of the parallel laser beams,A radius of a circular hole for the aperture stop 140;
As can be seen from the above formula, the total focal length formed by the combination of the plano-concave lens 120 and the convex lens 131 after filling Radius of Airy spot when increasingAlso, the resolution of the image data recording the spot information of the focal point is reduced, and subsequent measurement errors are likely to occur.
In order to solve the problem of non-contact liquid concentration measurement, a simple and effective capillary imaging method has been proposed in the prior art, namely, liquid is filled into a capillary tube to form a cylindrical lens, the imaging principle of a coaxial spherical optical system is utilized, information such as the shape, the position and the like of the capillary tube which is bent inwards after the liquid is filled in the focal point can be accurately obtained to measure the refractive index, and then the measured refractive index is used for determining the liquid concentration through the existing conversion relation; the conventional measurement method requires very small sample volume (less than 0.002 ml), but has low refractive index sensitivity due to too short focal length (about 2 mm), long distance measurement focus, is unfavorable for distinguishing specific focal plane positions, needs to perform focus searching in a mechanical scanning mode, takes long time, and is not easy to integrate, and compared with a capillary imaging method, the liquid concentration auxiliary measurement device shown in fig. 3 can prolong the focal length (namely, the focal length of the plano-concave lens 120 after liquid filling can be changed within the range of [ -117mm, -140mm ]), so that the focal depth is smaller, and is favorable for acquiring a more accurate and clear focal plane to judge the focal position, thereby improving the measurement accuracy, and performing focus searching in a geometric projection mode with shorter time consumption.
In a further preferred embodiment, the auxiliary focus device 130 in the auxiliary liquid concentration measuring apparatus shown in fig. 1 described above is exemplified.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating another structure of an auxiliary measuring device for liquid concentration according to an embodiment of the present invention, where the device includes a laser generator 110, a plano-concave lens 120, a thin scattering medium 132, an aperture diaphragm 140, and a CCD camera 150, and the Bao Sanshe medium 132 is the auxiliary focusing device 130.
In a specific implementation, when the plano-concave lens 120 is filled with a liquid sample, the laser generator 110 is configured to generate a parallel laser beam, the plano-concave lens 120 after filling is configured to diverge the parallel laser beam passing through the liquid sample and treat the parallel laser beam as a virtual focus outgoing divergent beam, the divergent beam penetrates the Bao Sanshe medium 132 to form a spatially distributed speckle signal, the aperture diaphragm 140 is configured to intercept a middle portion of the beam carrying the speckle signal and then transmit the intercepted beam to the CCD camera 150, and the CCD camera 150 is fixed on a defocus plane for performing an imaging process on the collected optical signal.
In this preferred embodiment, the minimum arrangement pitch between the plano-concave lens 120 and the Bao Sanshe medium 132 is set to 10mm, the minimum arrangement pitch between the Bao Sanshe medium 132 and the CCD camera 150 is also set to 10mm, and the minimum arrangement pitch between the Bao Sanshe medium 132 and the aperture stop 140 is set to 3mm.
In the practical application process, the wavefront modulation can make the diverging light beam form a focus at any point inside the diverging light beam after passing through the Bao Sanshe medium 132, the Bao Sanshe medium 132 after phase compensation can be regarded as a "lens" imaging system, and the following relationship exists between a light spot obtained by performing autocorrelation reduction on the speckle pattern received by the CCD camera 150 and a light spot generated before the diverging light beam is incident on the Bao Sanshe medium 132:
in the formula, For the distance of the Bao Sanshe medium 132 from the CCD camera 150,To provide the focal length of the filled plano-concave lens 120,For the radius of the aperture stop 140,As the spot radius, the spot radius is known from the above expressionFocal length of the plano-concave lens 120 after fillingThe focal length of the plano-concave lens 120 after filling is related to the refractive index of the liquid sample, so that the light spot size generated before the divergent light beam is incident on the Bao Sanshe medium 132 has a law of variation with the refractive index of the liquid sample.
It should be noted that, when the liquid sample presents a certain turbidity state, the device shown in fig. 4 is more suitable for performing auxiliary measurement on the liquid sample than the device shown in fig. 3, because the speckle particles can be collected to achieve a certain statistical average when the light beam passes through the Bao Sanshe medium 132, and then the speckle autocorrelation can show the light spot out of focus on the Bao Sanshe medium 132, so that the liquid sample is not required to be absolutely transparent, and the whole device is easier to build.
In a further preferred embodiment, the liquid concentration auxiliary measuring device shown in fig. 1 described above is further improved in view of the spatial arrangement of the device.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating another structural composition of an auxiliary liquid concentration measurement device according to an embodiment of the present invention, where the device includes a laser generator 110, a plano-concave lens 120, an auxiliary focusing device 130, an aperture diaphragm 140, a CCD camera 150, a first refractive mirror 160 and a second refractive mirror 170, where the first refractive mirror 160 is disposed below the auxiliary focusing device 130 and inclined at an angle, the inclination angle may be, but is not limited to, 45 degrees, the second refractive mirror 170 is disposed below the CCD camera 150 and is in a mirror image relationship with the first refractive mirror 160, and the aperture diaphragm 140 is disposed between the first refractive mirror 160 and the second refractive mirror 170.
In a specific implementation process, when the plano-concave lens 120 is filled with a liquid sample, the laser generator 110 is configured to generate a parallel laser beam, the plano-concave lens 120 after filling is configured to diverge the parallel laser beam passing through the liquid sample and treat the parallel laser beam as a virtual focus outgoing divergent beam, the virtual focus is materialized and outgoing to the photosurface of the CCD camera 150 in another form under the assistance of the auxiliary focus finding device 130 and the aperture diaphragm 140, and in the process, the light transmission direction is adjusted with assistance of the first refractor 160 and the second refractor 170, and the CCD camera 150 is fixed on an out-of-focus plane for performing imaging processing on the collected light signal.
It should be noted that if the device shown in fig. 1 is selected to assist in liquid measurement, the formed longitudinal optical path may have problems of limited position and difficult maintenance of the device, and in order to solve the problem, the device shown in fig. 5 may be selected to assist in liquid measurement.
Referring to fig. 6, fig. 6 is a flow chart of a method for measuring liquid concentration based on calculation and focus finding according to an embodiment of the present invention, where the method needs to use the liquid concentration auxiliary measuring device shown in fig. 1, and specifically includes the following steps:
step S210, when the plano-concave lens is filled with liquid to be measured, controlling the laser generator to generate parallel laser beams, wherein the parallel laser beams penetrate through the liquid to be measured and then generate emergent divergence change through the plano-concave lens, and the generated divergent beams are projected to a photosurface of the CCD camera through the auxiliary focus finding device and the aperture diaphragm;
step S220, controlling the CCD camera to be fixed on a defocused plane and carrying out imaging processing on the collected optical signals to obtain an image to be detected corresponding to the liquid to be detected;
step S230, analyzing the image to be detected to obtain the size of the light spot to be detected;
and step 240, calling a fitting relation between the concentration of the liquid and the size of the light spot, and substituting the size of the light spot to be detected into the fitting relation for calculation to obtain the concentration of the liquid to be detected.
It should be noted that, the data processing procedures of the step S230, the step S240, the fitting relation generation, and the like may be performed by a Python language, a MATLAB language, or other programming languages on a computer device, and the control actions of the step S210 and the step S220 may also be performed by the computer device.
In an embodiment, when the auxiliary focus-searching device is the convex lens, that is, the above-mentioned measuring method further selects the liquid concentration auxiliary measuring device as shown in fig. 3, the obtained image to be measured is actually a light spot original image, which mainly represents the focal information of the plano-concave lens after liquid filling on the defocus plane, as shown in fig. 7, the implementation process of the above-mentioned step S230 includes, but is not limited to, the following steps:
Step S231, performing binarization processing on the image to be detected to obtain a binarized image;
Step 232, performing segmentation processing on the binarized image to obtain a spot fitting image, as shown in fig. 8;
and step S233, taking the outermost circle fitting ellipse contained in the light spot fitting image as a boundary, acquiring the pixel area occupied by the light spot fitting image in the binarized image (namely, the pixel area within the boundary), and outputting the pixel area as the size of the light spot to be detected covered in the image to be detected.
In the step S232, the existing adaptive thresholding method is adopted to segment the binary image, and the segmentation threshold can be automatically adjusted according to the brightness of the light spot, and the light spot is not a true circle, so that the light spot is selected to be fitted into an ellipse for display; the self-adaptive threshold method has the advantages that the fitting circle is prevented from expanding outwards due to overlarge inner light intensity aiming at small light spots, the fitting circle is prevented from shrinking inwards due to the fact that the outer circle light intensity is too weak aiming at large light spots, the final fitting circle is more attached to the light spot size, and meanwhile the influence on liquid level caused by vibration, water waves, small bubbles and the like when the glass sheet is placed can be eliminated.
In still another embodiment, when the auxiliary focus-seeking device is the Bao Sanshe medium, that is, the above measurement method further selects a liquid concentration auxiliary measurement device as shown in fig. 4, the obtained image to be measured is actually a speckle pattern, which mainly represents speckle granule information of the plano-concave lens after liquid filling on a defocus plane, as shown in fig. 9, and the implementation process of the step S230 includes, but is not limited to, the following steps:
Step S230.1, processing the image to be detected by adopting a speckle autocorrelation imaging principle to obtain a spot image to be detected, wherein the spot image to be detected can currently represent focal information of the plano-concave lens after liquid filling on a defocusing plane as shown in FIG. 10, so that a speckle autocorrelation imaging recovery method is realized;
Step S230.2, performing binarization processing on the light spot image to be detected to obtain a binarized image;
Step S230.3, carrying out segmentation processing on the binarized image to obtain a facula fitting image;
And S230.4, taking the outermost ring fitting ellipse contained in the light spot fitting image as a boundary, acquiring the pixel area occupied by the light spot fitting image in the binarized image (namely, the pixel area within the boundary), and outputting the pixel area as the size of the light spot to be detected covered in the image to be detected.
In the step S230.1, the shape and size of the focal spot are separated from the random speckle included in the image to be measured, so as to restore the image of the spot to be measured, and the mathematical expression adopted in this implementation process is as follows:
in the formula, For the intensity of the auto-correlation of the speckle,For the image of the spot to be measured,Referring to the spike function as such,As the coefficient of the auto-correlation,Reference is made to an autocorrelation operation,Reference is made to a convolution operation,Reference is made to being proportional to the sign.
In order to improve the reliability of the image of the spot to be measured, a further improvement is proposed in the liquid concentration auxiliary measuring device shown in fig. 4, namely, a polarizer is added between the plano-concave lens 120 and the Bao Sanshe medium 132, the polarizer contained in the polarizer can rotate 360 degrees, the rotation surface of the polarizer is kept parallel to the Bao Sanshe medium 132, and meanwhile, the minimum arrangement interval between the plano-concave lens 120 and the Bao Sanshe medium 132 is increased, namely, the minimum arrangement interval between the plano-concave lens 120 and the polarizer is set to be 10mm, and the minimum arrangement interval between the polarizer and the Bao Sanshe medium 132 is set to be 10mm.
When the plano-concave lens is filled with the liquid to be measured, the polaroid is controlled to rotate according to a given rotation step length, different polarization directions are obtained once for each rotation, and then the CCD camera is controlled to perform an imaging operation to obtain a corresponding image to be measured, wherein the given rotation step length is assumed to beAt this time, after the polarizer completes 360 degrees of rotation, it can be obtainedZhang Daice images, wherein;
At this time, the existing speckle autocorrelation imaging principle is adopted for the imagingZhang Daice, processing the image to obtain an image of the light spot to be detected, wherein the mathematical expression adopted in the implementation process is as follows:
in the formula, The background noise in the mth polarization direction can be understood as the background noise that the CCD camera generates when acquiring the mth Zhang Daice image.
In the embodiment of the present invention, the generation process of the fitting relation between the liquid concentration and the spot size mentioned in the step S240 includes, but is not limited to, the following:
Step A1, obtaining N liquid samples which have different known concentrations and are the same as the type of the liquid to be detected, wherein N is a positive integer and is larger than 1;
a2, acquiring an ith liquid sample, and performing K imaging treatments on the ith liquid sample through the liquid concentration auxiliary measuring device so as to acquire K image samples corresponding to the ith liquid sample;
Step A3, analyzing the K image samples to obtain corresponding K light spot sizes;
step A4, averaging the K light spot sizes to obtain an average light spot size corresponding to the ith liquid sample;
step A5, judging whether the i+1 is smaller than or equal to N, if so, assigning the i+1 to the i, and then returning to execute the step A2, otherwise, indicating that N average spot sizes corresponding to the N liquid samples are acquired, and executing the step A6;
And A6, performing curve fitting on N known concentration values and N average light spot sizes corresponding to the N liquid samples to obtain a fitting relation between the liquid concentration and the light spot size.
To better illustrate the generation of the fitting relationship, an exemplary description is made herein as follows:
(1) Firstly setting the type of the liquid to be tested as alcohol (hereinafter described as alcohol to be tested), adopting the liquid concentration auxiliary measuring device shown in fig. 3 to finish concentration measurement of the alcohol to be tested and determine to generate a fitting relation, at the moment, selecting pure alcohol with concentration of 99.9% or 80% and loading the pure alcohol into the plano-concave lens 120, and starting the laser generator 110 and the CCD camera 150 to perform calibration experiments to determine the final layout position of the CCD camera 150;
(2) The experimental content comprises the steps of configuring 22 alcohol samples with different known concentrations, carrying out imaging processing on each alcohol sample for 5 times by using the liquid concentration auxiliary measuring device shown in fig. 3 to obtain 5 image samples, and then carrying out analysis and averaging processing on 5 image samples corresponding to each alcohol sample to obtain an average light spot size corresponding to each alcohol sample, wherein the average light spot size is shown in the table 1;
TABLE 1 known concentration values and average spot size for different alcohol samples
Curve fitting is performed on an alcohol sample as a data point according to each data shown in table 1, with a known concentration value of the alcohol sample as an abscissa axis and an average spot size corresponding to the alcohol sample as an ordinate axis, to obtain a fitting curve and a fitting relation reflecting the fitting curve between alcohol concentration and spot size as shown in fig. 11, wherein R 2 refers to a square root of a sum of squares of residuals between an output variable (spot size) and an independent variable (alcohol concentration), and is used for measuring an influence degree of the independent variable (alcohol concentration) on the fitting relation.
As can be seen from fig. 11, when the refractive index of the alcohol sample decreases, the concentration value decreases, but the spot size increases, which means that the total focal length formed by the combination of the plano-concave lens 120 and the convex lens 131 after filling becomes longer, reflecting that the virtual focal length of the plano-concave lens 120 after filling becomes shorter (i.e. the virtual focal point position approaches the CCD camera 150, and the total real focal point position is far from the CCD camera 150), which proves that the observation rule exists between the spot size of the changed light beam in the same spatial plane and the changed focal point position, and that it is feasible to determine the concentration value of the same type of alcohol to be measured by using the fitting relation.
(3) And in the later expansion application, the liquid concentration auxiliary measuring device shown in fig. 3 is used for carrying out single imaging treatment on the alcohol to be measured to obtain an image to be measured, then the image to be measured is analyzed to obtain a corresponding light spot size to be measured, and finally the light spot size to be measured is input into a fitting relation obtained in the experimental content to calculate so as to obtain a concentration value corresponding to the alcohol to be measured.
The reason for fixing the CCD camera 150 in connection with the method for measuring the liquid concentration based on the calculation focus finding shown in fig. 6 will be described below with respect to any one of the liquid concentration auxiliary measuring apparatuses shown in fig. 1, 3 to 5:
Unlike other interferometer devices, the CCD camera 150 can capture image information with phase data, the CCD camera 150 captures two-dimensional image information, which cannot directly reflect the focal position of the plano-concave lens 120 after liquid filling, if the focal position is found by using a conventional autofocus algorithm, the required calculation power of the imaging device and software is too high, and if the CCD camera 150 is replaced by an interferometer device to obtain an interference image to reflect the focal position, a simple optical path is not completed.
Therefore, the invention proposes to fix the relationship between the refractive index and focal length of the liquid by the CCD camera 150 and the related image processing algorithm, so that the change rule of the focal point where the light beam is collected and the light beam is converged on the same space plane can be followed, if the focal point position is found by moving the CCD camera 150, because the focal plane is clear in a certain range, the error is caused to the image distance measurement, and because the focal point position can change with the refractive index of the liquid, if the CCD camera 150 needs to be moved every time a liquid sample is measured, not only the equipment adjustment time is consumed, but also the determination of the focal length has artificial influence, so that the final liquid measurement result has larger error, and conversely, if the CCD camera 150 is fixed and the aperture diaphragm 140 is introduced to generate geometric projection, the influence of focal depth can be reduced, namely, after the geometric projection of the light beam onto the CCD camera 150, the focal depth can be accurately judged to be concentrated to an ideal point according to the small change of the light spot size, and the focal depth can be accurately converted into an accurate focal point.
It should be noted that, the method for measuring the liquid concentration based on the calculation focus finding according to the present invention is to explore the relationship between the light spot size and the liquid concentration, the light spot size is related to the focal length of the plano-concave lens 120 after liquid filling, the focal length is related to the liquid refractive index, and some physical quantities including, but not limited to, the liquid concentration and the liquid density can be obtained after the liquid refractive index is converted, which is understood that the device for measuring the liquid concentration based on the calculation focus finding according to the present invention can be applied to the measurement of the liquid refractive index and the liquid density, when the device for measuring the liquid concentration based on the calculation focus finding according to the present invention is applied to the measurement of the liquid refractive index, only the fitting relationship between the liquid refractive index and the light spot size obtained by invoking the pre-test method is required to be replaced in the method for invoking the fitting relationship between the liquid refractive index and the light spot size obtained by the pre-test method.
In the embodiment of the invention, the auxiliary measuring device for the liquid concentration is quickly built by utilizing common optical equipment in an optical laboratory, the integration level is high, the operation difficulty is low, a small amount of liquid samples of various types can be directly measured in a non-contact manner, pretreatment before experiments on the liquid samples is not needed, the practicability is good, the key parameters are obtained by introducing a machine vision technology to process images output by the device, and the key parameters are calculated by calling a reliable fitting relation to obtain the required measured data, so that the measuring accuracy and the reliability can be improved.
While the present application has been described in considerable detail and with particularity with respect to several described embodiments, it is not intended to be limited to any such detail or embodiments or any particular embodiment, but is to be considered as providing a broad interpretation of such claims by reference to the appended claims in light of the prior art and thus effectively covering the intended scope of the application. Furthermore, the foregoing description of the application has been presented in its embodiments contemplated by the inventors for the purpose of providing a useful description, and for the purposes of providing a non-essential modification of the application that may not be presently contemplated, may represent an equivalent modification of the application.