Refractive index measuring method and refractometer based on total reflection principle and image recognition

Through the refractive index measurement method based on the principle of total reflection and image recognition, the visible light source and rotation module are used, combined with the image acquisition and recognition module, the total reflection angle is calculated and the refractive index is obtained, which solves the problems of high cost, complex operation and precision efficiency in the prior art, and achieves efficient, economical and safe refractive index measurement.

CN119534396APending Publication Date: 2025-02-28HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411705235.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing refractive index measurement methods have high costs, complex operation, safety risks, difficulty in sample preparation and cleaning, accuracy and efficiency problems.

Method used

The refractive index measurement method based on the principle of total reflection and image recognition is adopted. The visible light source emits light to the container dish. The rotating module drives the container dish to rotate. The image acquisition module collects refracted light images in real time, and uses the image recognition module to calculate the total reflection angle and calculate the refractive index.

Benefits of technology

It realizes low-cost, high-precision, easy operation and good safety refractive index measurement, solves the problems of complex operation, safety hazards and precision efficiency in the prior art, and improves the cost-effectiveness of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119534396A_ABST
    Figure CN119534396A_ABST
Patent Text Reader

Abstract

The invention discloses a refractive index measuring method based on a total reflection principle and image recognition and a refractometer. The method comprises the following steps: collecting a refracted light image in real time, converting the refracted light image into a plurality of images, and screening out images in which refracted light spots disappear and light spots appear; and obtaining a total reflection angle of the measured solution according to images of disappearance and appearance of the light spot of the refracted light, and further calculating to obtain the refractive index of the measured solution. Through the phenomenon that critical angles of total reflection of different substances are different, only the light source is needed to emit visible light to the container filled with the to-be-measured solution, the rotating module drives the container to rotate to change an incident angle, the moment when the to-be-measured solution generates total reflection is collected, then the refractive index of the to-be-measured solution is calculated, the automation degree is high, and the measurement accuracy is high. The problem that in the prior art, a high-precision abbe refractometer of a pure optical structure is complex in operation is solved. The optical path is built through a simple principle, the cost is reduced while the precision is ensured, the input cost and the final effect are balanced, and the cost performance of the device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention mainly relates to the technical field of optical measurement of liquid refractive index, and in particular to a refractive index measurement method and a refractometer based on the total reflection principle and image recognition. Background Art

[0002] Refractive index is an important physical parameter that describes the interaction between light and matter. Especially in liquid media, the refractive index is usually directly related to the concentration of the liquid. Therefore, using the refractive index value to judge the quality of a sample has become an important identification method. Its application range is wide, covering optical design, material science, biomedicine and other fields, and plays an important role in lens performance research, water quality testing and other aspects.

[0003] The existing refractive index measurement methods in China mainly include the following categories: (1) Liquid refractive index measuring device based on the total reflection principle: This method determines the refractive index by directly measuring the total reflection angle when total reflection occurs.

[0004] (2) Spectrometer: used to measure the wavelength and intensity of light and indirectly determine the refractive index.

[0005] (3) Michelson interferometer: uses the interference principle to measure the optical path difference and then calculate the refractive index.

[0006] (4) Double air wedge and Newton's rings: Determine the refractive index by observing the interference pattern.

[0007] Although these methods have certain application value in refractive index measurement, they each have some disadvantages, such as (1) cost and operational complexity: measurement devices based on the total reflection principle usually require expensive angle sensors and complex operating procedures. (2) safety issues: the laser beam of the spectrometer may directly enter the eyes during measurement, posing a safety hazard. (3) sample preparation and cleaning difficulties: double air wedges and Newton rings require samples to be made into regular shapes, which increases costs and is not easy to clean. (4) accuracy and efficiency issues: existing methods may have time delays and human errors during the measurement process, affecting measurement accuracy and efficiency.

[0008] Therefore, a refractive index measuring device with lower cost, higher accuracy, easier operation and better safety is needed. Summary of the invention

[0009] The object of the present invention is to provide a refractive index measurement method and a refractometer based on the total reflection principle and image recognition in view of the deficiencies in the prior art.

[0010] In a first aspect, the present invention provides a refractive index measurement method based on the total reflection principle and image recognition, characterized in that the method comprises the following steps: Step S1, real-time acquisition of refracted light images; specifically: The visible light source emits visible light toward the containing dish.

[0011] The light source is fixed, and one side of the container containing the solution to be tested is adjusted to face the light source, and the refracted light is at the center of the refracted light collecting screen; the container is made of transparent material and is divided into two parts, one part is used to hold the solution to be tested, and the other part is empty.

[0012] Rotate the module at speed Control the dish containing the solution to be tested to rotate at a constant speed.

[0013] The image acquisition module acquires the image video of the refractive light collection screen in real time.

[0014] Step S2: convert the image video into a plurality of images, and filter out the images in which the refracted light spot disappears and the images in which the light spot appears.

[0015] Step S3: Obtain the total reflection angle of the solution under test based on the images of the disappearance and appearance of the refracted light spot. .

[0016] Step S4: According to the total reflection angle of the solution to be tested Calculate the refractive index .

[0017] Preferably, step S2 specifically includes: The image video is converted into several images, and then each image is preprocessed and converted into a binary image.

[0018] Count the non-zero pixel values ​​in each binary image to get the total number of non-zero pixel values ​​in each image , forming an array ;i=1,2,……,N; N represents the total number of images.

[0019] Initialize flag=0 and traverse the array , and then mark the image that satisfies formula (1) with flag ξ. If flag = 0, it means that the refracted light spot disappears, and if flag = 1, it means that the refracted light spot appears. Filter out all images marked with ξ, and then extract the serial number of the corresponding image to form the image serial number array number_list of the critical point of light spot change.

[0020] Formula (1) Preferably, step S3 specifically includes: All elements in the light spot change critical point image sequence array number_list are grouped in order of chronological order, with two elements in each.

[0021] For each group, the next serial number value is subtracted from the previous serial number value. The difference is the number of frames in which the light spot does not exist in the video. The difference is multiplied by the coefficient ɑ, and the multiplication result is used as the total reflection angle of the current group; the total reflection angles of each group are averaged to obtain the total reflection angle of the measured solution.

[0022] Preferably, in step S4, the refractive index The calculation formula is: Formula (2) in, represents the refractive index of the solution being measured, Represents the refractive index of air.

[0023] Preferably, the coefficient The calculation formula is: Formula (3) in, represents the rotation speed of the rotating module, f represents the image frequency, and k represents the correction coefficient.

[0024] In a second aspect, the present invention provides a visible light source, a containing dish, a rotating module, a refracting light collecting screen, an image acquisition module, and an image recognition module.

[0025] The containing dish is made of transparent material and is divided into two parts, one part is used to hold the solution to be tested and the other part is empty.

[0026] The visible light source is located at one side of the containing dish, and the visible light emitted by the visible light source can directly irradiate the containing dish.

[0027] The refracted light collecting screen is located at the other side of the containing dish, and the refracted light refracted by the solution to be tested in the containing dish can fall on the refracted light collecting screen.

[0028] The rotating module is used to realize the placing of dishes at a set speed. Rotate.

[0029] The image acquisition module is used to acquire the image video of the refractive light collecting screen in real time.

[0030] The image acquisition module acquires the image video of the refractive light collection screen in real time.

[0031] Beneficial effects of the present invention: The present invention provides a refractive index measuring method based on the total reflection principle and image recognition. By utilizing the phenomenon that different substances have different critical angles for total reflection, the present invention only requires a light source to emit visible light to a dish containing a solution to be tested, and a rotating module drives the dish to rotate to change the incident angle, and collects the moment when the solution to be tested undergoes total reflection, thereby calculating the refractive index of the solution to be tested. The method has a high degree of automation and solves the problem of complex operation of a high-precision pure optical structure Abbe refractometer in the prior art.

[0032] The present invention constructs an optical path through a simple principle, thereby ensuring accuracy while reducing costs, balancing the input cost and the final effect, and improving the cost performance of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 It is a flow chart of the method provided by an embodiment of the present invention.

[0035] Figure 2 A schematic diagram of the structure of a refractometer provided in an embodiment of the present invention.

[0036] Markings in the figure: 1. single-chip microcomputer; 2. stepper motor; 3. camera; 4. refracting light collecting screen; 5. filter plate; 6. holding dish; 7. light shrinking lens group; 8. laser source; 9. outer shell; 10. fixing plate; 11. turntable. DETAILED DESCRIPTION

[0037] As can be seen from the background technology, although the current existing refractive index measurement methods have played a certain role in their respective application scenarios, they all have some limitations. Although the liquid refractive index measuring device based on the total reflection principle is direct in principle, it is usually necessary to be equipped with an expensive angle sensor, and the operation process is complicated, and the professional skills of the operator are required to be high, which not only increases the measurement cost, but also limits its application in some small laboratories or on-site detection. During the measurement process, the spectrometer uses a laser beam as a light source, and the high intensity and high energy characteristics of the laser beam make it have a large safety hazard during operation. If the laser beam is accidentally shot directly into the eyes, it may cause irreversible damage to the eyes. The double air wedge and Newton ring measurement methods need to prepare the sample into a regular shape. This process not only increases the difficulty and cost of sample preparation, but also the cleaning work of the sample after measurement is relatively cumbersome, which is not conducive to fast and efficient multiple measurements. In addition, existing measurement methods also have certain problems in terms of measurement accuracy and efficiency. Some methods may cause time delays during the measurement process due to factors such as equipment response time and data processing speed. At the same time, errors in the human operation process are difficult to completely avoid. These factors combined affect the accuracy and reliability of the measurement results, and cannot meet some scientific research and industrial application needs that have high requirements for accuracy and efficiency.

[0038] Therefore, the present invention provides a refractive index measuring device and method, which have the advantages of low cost, high precision, simple operation and good safety.

[0039] The invention provides a refractometer based on the total reflection principle and image recognition, comprising a visible light source, a containing dish, a rotating module, a refracted light collecting screen, an image acquisition module and an image recognition module.

[0040] The container is made of transparent material and is divided into two parts, one part is used to hold the solution to be tested and the other part is empty; during the rotation process, the visible light is projected onto the liquid medium of the solution to be tested in half of a cycle and onto the air medium in the other half.

[0041] The visible light source is located at one side of the containing dish, and the visible light emitted by the visible light source can directly irradiate the containing dish.

[0042] The refracted light collecting screen is located at the other side of the containing dish, and the refracted light refracted by the solution to be tested in the containing dish can fall on the refracted light collecting screen.

[0043] The rotating module is used to realize the placing of dishes at a set speed. Rotate.

[0044] The image acquisition module is used to acquire the image video of the refractive light collecting screen in real time.

[0045] The image acquisition module acquires the image video of the refractive light collection screen in real time.

[0046] The present invention also provides a refractive index measurement method based on the total reflection principle and image recognition, comprising the following steps: Step S1, real-time acquisition of refracted light images; specifically: The visible light source emits visible light toward the containing dish.

[0047] Fix the light source and adjust the side of the dish containing the solution to be tested to face the light source, and make the refracted light at the center of the refracted light collecting screen.

[0048] Rotate the module at speed Control the dish containing the solution to be tested to rotate at a constant speed.

[0049] The image acquisition module acquires the image video of the refractive light collection screen in real time.

[0050] Step S2, converting the image video into a plurality of images, and screening out the images where the refracted light spot disappears and where the light spot appears; specifically comprising the following steps: The image video is converted into several images, and then each image is preprocessed and converted into a binary image.

[0051] Count the non-zero pixel values ​​in each binary image to get the total number of non-zero pixel values ​​in each image , forming an array ;i=1,2,……,N; N represents the total number of images; where middle Sort the images in order of appearance.

[0052] Initialize flag=0 and traverse the array , and then mark the image that satisfies formula (1) with flag ξ. If flag = 0, it means that the refracted light spot disappears, and if flag = 1, it means that the refracted light spot appears. Filter out all images marked with ξ, and then extract the serial number of the corresponding image to form the image serial number array number_list of the critical point of light spot change.

[0053] Step S3: Obtain the total reflection angle of the solution under test based on the images of the disappearance and appearance of the refracted light spot. ; Specifically including the following steps: All elements in the light spot change critical point image sequence array number_list are grouped in order of chronological order, with two elements in each.

[0054] Since the light spot will change twice when the light passes through the total reflection angle, that is, the light spot disappears and then appears. Therefore, after the array number_list is divided into two groups according to the above steps, each group uses the next serial number value minus the previous serial number value. The difference is the number of frames in which the light spot does not exist in the video. The difference is multiplied by the coefficient ɑ to obtain a number of values, that is, a number of total reflection angles. The total reflection angles of each group are averaged to obtain the total reflection angle of the measured solution.

[0055] in represents the 2mth sequence number, M represents the number of packets, Represents the total reflection angle.

[0056] coefficient The calculation formula is: in, represents the rotation speed of the rotating module, f represents the image frequency, that is, the frame rate of the camera, and k represents the correction coefficient.

[0057] Step S4: According to the total reflection angle of the solution to be tested Calculate the refractive index ; in, represents the refractive index of the solution being measured, Represents the refractive index of air, usually taken as 1.0003.

[0058] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0059] This embodiment 1 provides a method for measuring refractive index based on total reflection, the process is as follows Figure 1 As shown, the specific implementation steps are as follows: Step 1. Add an appropriate amount of the liquid to be tested to one side of the dish and leave the other side empty. Turn on the light source to emit stable visible light. At this time, the light passes through the light-contracting lens group, passes through the interface between the solution to be tested and the air in the dish, and is refracted. The refracted light is projected onto the refracted light collection screen and forms an image. By observing the approximate position of the refracted light on the collection screen, preliminarily adjust the position and angle of the dish to make the refracted light as close to the center area of ​​the collection screen as possible for subsequent image acquisition and analysis.

[0060] Step 2. Start the program, use cv2.VideoCapture() to open the image acquisition module, use cv2.VideoWriter_fourcc() function to set the video encoding format, and use cv2.VideoWriter() function to shoot the video. The image acquisition module starts to collect the image video on the refracted light collection screen in real time at a preset frame rate (such as 30fps). During the acquisition process, continuously monitor the image quality to ensure that the image is clear and stable without obvious blur or jitter. If the image quality is found to be degraded, such as increased noise or uneven brightness, check the stability of the light source, whether the camera connection is loose, or whether the ambient light has changed, and make corresponding adjustments.

[0061] At the same time, relevant parameters such as the acquisition start time, acquisition frame rate, and rotation speed are recorded. These parameters will be used to accurately calculate the total reflection angle and refractive index in subsequent data processing. The acquired image and video data are transmitted in real time and stored in the computer's hard disk. The storage format can be a lossless compression format (such as PNG sequence) to ensure the integrity and accuracy of the image data.

[0062] Step 3: After the shooting starts, use the ser.write() function to start the rotation module and set its rotation speed to the preset value V. 0 . For example, according to the measurement accuracy and equipment performance, the rotation speed can be set between 0.5° / s - 5° / s. The rotation module drives the container to rotate at a constant speed. During the rotation, the incident angle of the light changes continuously, and the direction and intensity of the refracted light also change accordingly. At the same time, the image acquisition module starts to collect image videos of the refracted light collection screen in real time. The frame rate f of image acquisition should be selected according to the measurement requirements and the processing capacity of the equipment, generally between 15fps- 60fps. When acquiring images, ensure the clarity and stability of the image to avoid factors such as changes in ambient light and equipment vibration that affect the image quality.

[0063] Step 4. After the shooting is finished, stop the servo, turn off the image acquisition module and save the video. The image acquisition module transmits the acquired image and video data to a computer or other data storage device in real time for storage. The stored image data format should be convenient for subsequent image processing and analysis, such as common JPEG, PNG or RAW formats. During the data storage process, ensure the integrity and accuracy of the data to avoid data loss or damage. At the same time, record the rotation speed V of the rotating module. 0 , image acquisition frame rate f and acquisition time and other related parameters, which will be used in subsequent data processing.

[0064] Step 5. Execute ret, frame = cap.read() to read the frame image from the video, slice the stored image video, extract each frame image and save it, naming it image.

[0065] Step 6. Execute image = image[140:340, 0:640] to crop the image to a suitable size.

[0066] Step 7. Execute gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) to convert each BGR color image into a grayscale image one by one. Use the weighted average method for grayscale conversion. For example, according to the sensitivity of the human eye to different colors, set the weights of the red, green, and blue components to 0.299, 0.587, and 0.114 respectively, and calculate the grayscale value of each pixel using the formula Gray = 0.299×R + 0.587×G + 0.114×B. Grayscale images can simplify subsequent image processing algorithms, reduce the amount of calculation, and retain key information about light intensity.

[0067] Step 8. Execute blurred = cv2.GaussianBlur(gray, (11, 11), 0) to set each image to a Gaussian filter with a 11*11 Gaussian kernel and a standard deviation of 0 in the X and Y directions to remove noise interference in the image and smooth the image.

[0068] Step 9. Execute thresh = cv2.threshold(blurred, 40, 255, cv2.THRESH_BINARY)[1] to change the pixel values ​​of pixels with a value greater than 40 in each image to 255 (white, indicating the refracted light spot), and the pixel values ​​of pixels with a value less than 40 to 0 (black, indicating the background), i.e., perform binarization and save the processed image. The binarized image can highlight the refracted light spots, making it easier to identify and count the light spots.

[0069] Step 10. Get all the processed binary images, use cv2.countNonZero() function to count the non-zero pixel values ​​in each image one by one, and record the total number of non-zero pixel values ​​in each image in the order of the images in a one-dimensional array sum_list. This array reflects the intensity information of the refracted light spots in each image. By analyzing the array, the moment when the light spots disappear and appear can be detected.

[0070] Step 11. Due to the principle design of the overall device, the light spot will only change in sequence following the rule of "disappearance--appearance--disappearance--appearance...", so a judgment variable flag is set.

[0071] Initialize the flag flag = 0, traverse sum_list, and mark the images that meet the conditions with ξ. If flag = 0, it means that the refracted light spot disappears, and if flag = 1, it means that the refracted light spot appears.

[0072] Filter out all images marked with ξ, extract the serial numbers of these images, and form the image serial number array number_list of the critical point of light spot change. During the screening process, carefully check the accuracy of the mark to ensure that there is no misjudgment or omission. If anomalies are found, such as the order of light spot disappearance and appearance is not in line with expectations or the number of marks is too many or too few, recheck whether the image preprocessing steps and threshold selection are reasonable.

[0073] Step 12: Divide the values ​​in first_list into groups of two in order and record them in the nested array data_list.

[0074] Step 13 traverses data_list, and in each group, subtracts the previous value from the next value, and the difference is the number of frames in which the light spot does not exist in the video.

[0075] The coefficient is calculated according to the following formula (such as 0.058273590889151565), the above difference and the coefficient Multiply them to get the total reflection angle of the current group and record it in a new one-dimensional array result_list, that is, the total reflection angle array.

[0076] in, represents the rotation speed of the rotating module (such as 2° / s), f represents the image frequency (such as 30fps), that is, the frame rate of the camera, and k represents the correction coefficient (determined by experimental calibration, assuming k = 1.05). In actual measurement, it is necessary to determine the value of the correction coefficient k according to the specific equipment parameters and measurement environment to improve the accuracy of the total reflection angle calculation.

[0077] Step 14: Average the total reflection angles calculated for each group to obtain the total reflection angle of the measured solution. When calculating the average value, exclude abnormal values ​​(such as individual values ​​that deviate from other total reflection angle values ​​by more than ±10%). This averaging process can reduce random errors in the measurement process and improve the accuracy of total reflection angle measurement.

[0078] Step 15: According to the total reflection angle of the solution being tested Calculate the refractive index of the solution being tested This calculation process is based on the principle of total reflection. By accurately measuring the total reflection angle, the refractive index of the solution being measured can be accurately calculated.

[0079] According to the following formula, the refractive index n of the measured solution is calculated by inverse trigonometric function operation. In the calculation process, a high-precision mathematical calculation library (such as the math library in Python) is used to ensure the accuracy of the calculation results and retain four significant digits after the decimal point.

[0080] in, represents the refractive index of the solution being measured, Represents the refractive index of air, usually taken as 1.0003.

[0081] The calculated refractive index n of the measured solution is displayed on the display screen. The display screen can be a computer monitor, a liquid crystal display screen built into the instrument, or other suitable display devices. The displayed results should be clear and accurate, and relevant measurement parameters such as the total reflection angle θ, the rotation speed V 0 , image acquisition frame rate f, etc., so that users can fully understand and analyze the measurement results.

[0082] Users can analyze and verify the measurement results. For example, the measured refractive index can be compared with the known refractive index of the standard solution to check the accuracy of the measurement results. If there is a large deviation between the measurement result and the standard value, various links in the measurement process can be checked, such as whether the sample preparation is correct, whether the equipment is working properly, and whether the measurement parameters are set reasonably. At the same time, the same solution to be tested can be measured repeatedly, the average value and standard deviation of the measurement results can be calculated, and the repeatability and stability of the measurement method can be evaluated. If necessary, the measurement method can be further optimized and improved, such as adjusting the light source intensity, changing the image acquisition parameters, optimizing the image processing algorithm, etc., to improve the measurement accuracy and reliability.

[0083] Through the above detailed specific implementation methods, the refractive index measurement based on the total reflection principle and image recognition can be accurately and reliably realized, providing an efficient and precise method for measuring the refractive index of liquids. In the actual operation process, each step and parameter can be appropriately adjusted and optimized according to the specific situation to adapt to different measurement requirements and environmental conditions.

[0084] like Figure 2 As shown, the present invention provides a fully automatic intelligent refractometer based on total reflection, including a housing, a visible light source 8, a containing dish 6, a rotating module, a refracted light collecting screen, an image acquisition module, and an image recognition module.

[0085] The housing is made of acrylic plate material, which includes a housing body 9 and a fixing plate 10 for fixing the visible light source 8. In addition, in addition to the acrylic plate material, a metal frame combined with an acrylic plate can also be considered to enhance the overall strength and stability of the housing and reduce the impact of collision or vibration on the internal optical components and electronic equipment. In terms of structural design, the connection method and layout of the components are optimized to improve the seismic resistance and maintainability of the equipment, so as to facilitate the inspection and maintenance of the equipment during long-term use.

[0086] The visible light source 8 may be a 635nm monochromatic laser source to provide stable and specific wavelength light for measurement; The refracted light collecting screen 4 may be made of a black translucent acrylic plate, which is helpful for clearly observing and collecting refracted light signals.

[0087] The rotating module includes a stepper motor 2 and a turntable 11, and the rotation speed of the turntable is controlled by the stepper motor 2; the stepper motor 2 can accurately control the rotation speed of the turntable 11 to ensure that the rotation speed of the container 6 is stable and adjustable during the measurement process, and its speed control is crucial for the subsequent accurate acquisition of the total reflection angle. In addition, high-precision bearings and transmission gears can be selected to reduce mechanical friction and shaking during the rotation process, and ensure the stability and speed stability of the container 6 during the rotation process. At the same time, the stepper motor 2 is temperature controlled and overload protected to prevent overheating of the motor due to long-term operation or damage due to overload, thereby extending the service life of the equipment.

[0088] The image acquisition module uses a camera 3. Of course, the camera 3 can use a device with higher resolution and frame rate. High resolution can capture more subtle light changes, increase the pixel information in the image, and help to more accurately identify the position and intensity changes of the refracted light point. A higher frame rate can obtain more image frames per unit time, making the capture of the change in the total reflection angle more delicate, especially at the moment of total reflection, more key data points can be obtained, and the measurement error caused by insufficient frame rate can be reduced. At the same time, in the selection of the camera lens, a professional optical filter can be equipped to further optimize the light spectrum characteristics, enhance the sensitivity to light of a specific wavelength, improve the contrast and clarity of the image, and thus improve the accuracy of the refractive index measurement.

[0089] One side of the dish 6 is filled with a proper amount of the liquid to be tested, and the other side is left empty. This design allows the light to refract when passing through the solution to be tested and the air, thereby facilitating the measurement of the total reflection angle. The amount of the liquid to be tested needs to be moderate, ensuring that the light can fully interact with the solution, but not too much or too little to affect the measurement result. For example, for some common liquid samples, such as saline solutions or organic solutions, the amount added can be empirically estimated based on the size of the dish and the concentration range of the solution, generally between a few milliliters and more than ten milliliters, and can be specifically determined by referring to the standard dosage in similar measurement methods or by preliminary experiments.

[0090] When the refractometer is needed for detection, first connect the power supply of the visible light source 8 and the stepper motor 2 to the 220V voltage, and then insert the connectors of the microcontroller 1 and the camera 3 into the USB interface of the computer to realize the interaction of data transmission and control signals, laying the foundation for subsequent automated operations.

[0091] Click Run, the motor 2 starts to rotate and drives the container 6 to rotate, and the camera 3 starts shooting. Turn on the light source, and the 635nm monochromatic laser source emits light of a specific wavelength, and the light passes through the light-shrinking lens group 7. The function of the light-shrinking lens group 7 is to reduce the diameter of the light emitted by the light source and make it emit in parallel. This step can effectively improve the accuracy of the measurement. The light after the light shrinking process is projected on the container 6. The light is refracted when passing through the container wall and the solution to be tested therein. The refracted light passes through the filter plate 5 (the green filter plate can further optimize the spectrum characteristics of the light and reduce the interference of stray light) and is projected onto the refracted light collecting screen 4. The filter plate 5, the refracted light collecting screen 4, and the camera 3 are fixed at the other end inside the shell body 9.

[0092] After the camera 3 acquires the image video, it processes it through the image recognition module to obtain the refractive index, and the refractive index of the liquid to be tested is displayed on the display screen.

[0093] In addition, the present embodiment may also integrate an automatic calibration function in the refractometer. Before each measurement, the device is automatically calibrated using a built-in standard sample or a reference solution of known refractive index. The calibration process may include the detection and adjustment of key components such as light source intensity, camera parameters, and rotation module speed to ensure that the device is in the best working state before measurement, reduce measurement errors caused by device drift or environmental changes, and improve the reliability and repeatability of measurement results.

[0094] Therefore, the present invention realizes the automatic change of the incident angle by cleverly using a light source (such as a red laser source) to emit visible light (such as red light) to the container containing the solution to be tested, and drives the container to rotate with the help of a rotating module. During the entire measurement process, only simple initial settings are required, such as turning on the light source, starting the program, etc., and subsequent measurement operations are automatically completed by the equipment without frequent manual intervention. For example, when measuring solutions of different concentrations, only the solution to be tested needs to be replaced, and the equipment can automatically complete a series of operations such as image acquisition, data analysis, and refractive index calculation, which greatly reduces the labor intensity and operation difficulty of the operator and improves the measurement efficiency.

[0095] The use of a light-reducing lens group and a carefully designed appropriate focal length can effectively reduce the diameter of the light emitted by the light source and make it emit in a highly parallel state. This optimized optical path design makes the refractive behavior of light when passing through the solution to be tested more consistent with the ideal optical model, so that the collected critical angle data is closer to the actual situation. Compared with the traditional handheld cutting refractometer, the present invention can significantly improve the measurement accuracy and meet the demand for high-precision refractive index measurement in scientific research. For example, in the study of the refractive index of optical materials, high-precision measurement results can provide more accurate data support for material performance analysis, which helps to promote the in-depth development of related scientific research.

[0096] The present invention uses a simple and ingenious principle to build an optical path, avoiding the use of complex and expensive optical components and sensors. Under the premise of ensuring measurement accuracy, the equipment cost is effectively compressed, a good balance between the input cost and the final measurement effect is achieved, and the cost performance of the device is improved. This makes the present invention have a wider application potential in various laboratories, scientific research institutions, and industrial production sites. Whether it is basic research in a small laboratory or quality control in large-scale industrial production, reliable refractive index measurement results can be obtained at a lower cost.

[0097] Compared with measuring equipment such as spectrometers that use laser beams and have potential safety hazards, the visible light source (such as a red light laser source) used in the present invention has relatively low light intensity and energy while ensuring the measurement function, and will not cause direct damage to the operator's eyes and other parts of the body, effectively reducing the safety risks in the measurement process and providing the operator with a safer and more reliable working environment.

[0098] The refractometer of the present invention has a reasonable structural design and can be applied to various types of solutions to be tested, whether it is a common aqueous solution, an organic solution, or some liquid samples with special properties, as long as the liquid can undergo obvious refraction within the wavelength range of the visible light source, the device of the present invention can be used to measure the refractive index. At the same time, by adjusting parameters such as the wavelength of the light source and the rotation speed, its application range can be further expanded to meet the measurement needs of different fields and different samples, and it has strong versatility and flexibility.

[0099] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A refractive index measurement method based on total reflection principle and image recognition, characterized in that The method comprises the following steps: Step S1, real-time acquisition of refracted light images; specifically: The visible light source emits visible light toward the containing dish; The light source is fixed in position, and one side of the container containing the solution to be tested is adjusted to face the light source, and the refracted light is at the center of the refracted light collecting screen; the container is made of a transparent material, and the container is divided into two parts, one part is used to hold the solution to be tested, and the other part is empty; Rotate the module at speed Control the dish containing the solution to be tested to rotate at a constant speed; The image acquisition module acquires the image video of the refraction light collection screen in real time; Step S2, converting the image video into a plurality of images, and screening out the images in which the refracted light spot disappears and the images in which the light spot appears; Step S3: Obtain the total reflection angle of the solution under test based on the images of the disappearance and appearance of the refracted light spot. ; Step S4: According to the total reflection angle of the solution to be tested Calculate the refractive index .

2. The method according to claim 1, characterized in that: Step S2 specifically includes: Convert the image video into several images, and then pre-process each image and convert it into a binary image; Count the non-zero pixel values ​​in each binary image to get the total number of non-zero pixel values ​​in each image , forming an array ;i=1,2,……,N; N represents the total number of images; Initialize flag=0 and traverse the array , then mark the image satisfying formula (1) with flag ξ, if flag=0, it means the refracted light spot disappears, if flag=1, it means the refracted light spot appears; filter out all images marked with ξ, then extract the serial number of the corresponding image, and form the image serial number array number_list of the critical point of light spot change; Formula (1).

3. The method according to claim 2, characterized in that: Step S3 specifically includes: All elements in the light spot change critical point image sequence array number_list are grouped in order of chronological order, with two elements in each group; For each group, the next serial number value is subtracted from the previous serial number value. The difference is the number of frames in which the light spot does not exist in the video. The difference is multiplied by the coefficient ɑ, and the multiplication result is used as the total reflection angle of the current group; the total reflection angles of each group are averaged to obtain the total reflection angle of the measured solution.

4. The method according to claim 1, characterized in that: Step S4 Refractive Index The calculation formula is: Formula (2) in, represents the refractive index of the solution being measured, Represents the refractive index of air.

5. The method according to claim 3, characterized in that: coefficient The calculation formula is: Formula (3) in, represents the rotation speed of the rotating module, f represents the image frequency, and k represents the correction coefficient.

6. A refractometer for implementing the method according to any one of claims 1 to 5, characterized in that It includes a visible light source, a holding dish, a rotating module, a refracted light collecting screen, an image acquisition module, and an image recognition module; The container is made of transparent material and is divided into two parts, one part is for placing the solution to be tested and the other part is empty; The visible light source is located on one side of the containing dish, and the visible light emitted by the visible light source can directly irradiate the containing dish; The refracted light collecting screen is located at the other side of the containing dish, and the refracted light refracted by the solution to be tested in the containing dish can fall on the refracted light collecting screen; The rotating module is used to realize the placing of dishes at a set speed. Rotation; The image acquisition module is used to acquire the image video of the refractive light collection screen in real time; The image acquisition module acquires the image video of the refractive light collection screen in real time.