A high-precision ruler scale recognition method and system based on machine vision

By monitoring ambient light and adjusting the light source, identifying and compensating environmental vibration, and dynamically adjusting image parameters, the accuracy of the scale recognition system in the light and vibration environment is solved, and high-precision scale recognition is achieved.

CN119049030BActive Publication Date: 2024-12-27SHENZHEN XIWEI SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411519347.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2024-12-27
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In an environment with variable lighting conditions and environmental vibration, existing scale recognition systems are difficult to ensure image quality and measurement accuracy, resulting in an increased risk of misreading and error measurements, especially under harsh conditions, with high operating complexity and error rates.

Method used

By constructing an initial mathematical model, monitoring ambient light and automatically adjusting the intensity and angle of the light source, the reflection characteristics of the scale line under different light are analyzed in real time; combining with Fourier transform to identify the environmental vibration characteristics, adjust the image processing parameters in real time for vibration compensation, and dynamically Adjust image contrast and sharpness to ensure accuracy of scale readings.

Benefits of technology

It significantly improves the clarity and consistency of the image under different lighting conditions, reduces image offset and distortion caused by environmental vibration, ensures the accuracy and stability of measurement, and reduces measurement deviations caused by environmental factors and mechanical errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119049030B_ABST
    Figure CN119049030B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of scale recognition technology, specifically to a high-precision ruler scale recognition method and system based on machine vision, comprising the following steps: constructing an initial mathematical model based on calibrated pixel coordinates and actual water ruler coordinates, monitoring the intensity and quality of ambient light, analyzing the reflection characteristics of scale lines under differential lighting conditions, automatically adjusting the light source intensity and angle according to the analysis results, matching the changes in ambient light conditions, and generating an adjusted light source model. In the present invention, by deeply observing the scale lines in the image and adjusting the image processing parameters in real time through vibration feature analysis, the image offset and distortion caused by environmental vibration are greatly reduced, the accuracy and stability of the measurement are ensured, the image contrast and sharpness are dynamically adjusted, and the exact scale reading is calculated according to the real-time image analysis results, the stability of the operation and the data processing speed are improved, and the measurement deviation caused by environmental factors and mechanical errors is significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of scale recognition, and in particular to a high-precision ruler scale recognition method and system based on machine vision. Background Art

[0002] The field of scale recognition technology mainly involves the use of machine vision systems to identify and interpret scale lines or other marks on physical scales. It is widely used in automated measurement and control systems to improve reading accuracy and reduce human errors. Scale recognition systems usually include image capture devices, image processing software and algorithms that can detect, locate and interpret scale lines from images, allowing scale recognition systems to automatically perform accurate measurements in various industrial, scientific and commercial applications, such as quality control in manufacturing, reading of laboratory instruments and precise positioning of medical equipment.

[0003] Among them, the high-precision ruler scale recognition method of machine vision involves the use of machine vision technology to automatically identify and analyze the scale on the ruler. Its main purpose is to provide an efficient and accurate scale reading solution, reduce errors in the manual reading process, and improve the speed and accuracy of data processing. It is suitable for fields that require high-precision measurement data, such as precision engineering, scientific research, and medical testing, making measurement activities more automated and accurate, especially in harsh environments or when manual operation requirements are high.

[0004] Common limitations of existing technologies in scale recognition systems include the impact of lighting conditions on image quality and insufficient processing of environmental vibrations. In environments with variable lighting conditions, unoptimized image capture devices may not be able to effectively adjust the light source, resulting in inconsistencies in the clarity and contrast of captured images, which directly affects the resolution efficiency of image processing software and algorithms. In addition, traditional technologies often lack effective vibration compensation mechanisms, making images susceptible to environmental vibration interference, increasing the risk of misreading or erroneous measurements. This limits the automation and accuracy of measurement activities, especially in environments with harsh environmental conditions or extremely high requirements for operational precision. Technical limitations significantly increase the complexity and error rate of operations. Summary of the invention

[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a high-precision ruler scale recognition method and system based on machine vision.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: a high-precision scale recognition method based on machine vision, comprising the following steps:

[0007] S1: Based on the calibrated pixel coordinates and the actual water level coordinates, an initial mathematical model is constructed to monitor the intensity and quality of the ambient light, analyze the reflection characteristics of the scale under different lighting conditions, and automatically adjust the light source intensity and angle according to the analysis results to match the changes in ambient light conditions and generate an adjusted light source model;

[0008] S2: using the adjusted light source model to verify the adjusted lighting conditions, capturing a continuous image sequence through a camera, performing real-time analysis of the light intensity and scale line visibility for each frame of the image, and generating pre-processed image data;

[0009] S3: Based on the pre-processed image data, deeply observe the scale lines in the continuously captured images, identify the image offset and distortion caused by environmental vibration, determine the vibration characteristics through high-frequency analysis according to the image offset and distortion identification results, adjust the image processing parameters in real time to perform vibration compensation, and generate a vibration compensated image;

[0010] S4: Analyze the shape and position of the scale lines using the vibration compensated image, dynamically adjust the image contrast and sharpness, calculate the exact scale reading based on the dynamic adjustment result, determine the actual position, adjust and optimize the final output reading based on the data, and obtain a high-precision scale recognition result.

[0011] As a further solution of the present invention, the analysis steps of the reflection characteristics of the scale lines under differential illumination conditions are:

[0012] S111: by collecting pixel coordinates and water ruler coordinates in the actual scene, applying linear regression technology to build a coordinate conversion model, performing pixel to actual scale mapping, and generating a pixel to water ruler coordinate conversion model;

[0013] S112: Based on the pixel-to-water-rule coordinate conversion model, a light sensor is used to record the intensity and quality of the current ambient light in real time, and a statistical analysis method is applied, using the formula:

[0014]

[0015] Calculate the average light intensity , generate ambient light quality monitoring results, where is the light intensity measured at a single time, is the total number of samples;

[0016] S113: In combination with the ambient light quality monitoring result, the reflectivity of the scale line under different lighting conditions is analyzed, using the formula:

[0017]

[0018] Calculate the average reflectivity , generate the analysis results of the scale line light reflection characteristics, where Intensity A single reflectance measurement under and are adjustment factors representing the reflectance sensitivity and baseline offset, respectively.

[0019] As a further solution of the present invention, the step of obtaining the adjusted light source model is:

[0020] S121: Based on the analysis result of the light reflection characteristics of the scale line, the formula is used:

[0021]

[0022] Calculate the adjusted light intensity , generate light source adjustment instructions, where, and is the adjustment factor;

[0023] S122: inputting the light source adjustment instruction, simulating the light source effect under different environmental conditions, verifying the applicability of the light source adjustment solution, and generating simulation test data;

[0024] S123: According to the simulation test data, actual light source control adjustment is performed, the light source intensity and angle are updated in real time to ensure matching with ambient light conditions, and an adjustment light source model is generated.

[0025] As a further solution of the present invention, the step of obtaining the pre-processed image data is:

[0026] S211: Based on the adjusted light source model, start the lighting condition verification, monitor the consistency between the actual lighting and the predetermined parameters, match the image capture standard, and generate the verified lighting condition data;

[0027] S212: Based on the verified illumination condition data, using a camera to capture a continuous scale image sequence, and performing a preliminary analysis on the continuous image sequence to ensure that each frame meets a preset image quality standard, thereby generating a high-quality image sequence;

[0028] S213: Perform depth analysis using the high-quality image sequence, using the formula:

[0029]

[0030] Calculate the visibility score for each frame , accurately reflects the clarity and visibility of the image under the current lighting conditions, and generates pre-processed image data, where represents the average light intensity extracted from the image data, represents the average scale signal strength, is the weighting coefficient of light intensity, which is used to adjust the influence of light intensity in visibility score. is the weighting coefficient of the scale line signal strength, which is used to improve the contribution of scale line clarity to the visibility score. is a factor used to adjust the sensitivity of the overall visibility calculation.

[0031] As a further solution of the present invention, the steps of identifying image offset and distortion are:

[0032] S311: importing the pre-processed image data, performing initialization image analysis, and performing depth observation on the continuously captured images; eliminating interference from external factors, and generating image sequence analysis initialization results;

[0033] S312: using the image sequence analysis initialization result, observing the scale line of each frame of the image, using edge detection and morphological transformation to identify the offset and distortion in the image, recording each change instance data, and generating image offset and distortion records;

[0034] S313: Summarize and preliminarily evaluate the image offset and distortion records, screen the environmental vibration caused by non-human operation by comparing the changes between frames, and generate an environmental vibration recognition result.

[0035] As a further solution of the present invention, the step of acquiring the vibration compensation image is:

[0036] S321: Based on the environmental vibration recognition result, Fourier transform is applied to extract key vibration frequencies, using the formula:

[0037]

[0038] Determine and output frequency eigenvector ,in, Represents the image sequence Frame displacement data, Indicates the frame number. Represents the total number of image frames, is the complex exponential part of the Fourier transform, which converts the time series into a frequency series. Indicates plural, represents a real number;

[0039] S322: According to the frequency feature vector, real-time adjustment of image processing parameters is performed using the formula:

[0040]

[0041] Calculate the new parameter quantization value , get the updated parameter data, where represents the original parameter quantization value, To adjust the coefficients and ensure timely response to environmental vibrations, represents the maximum value in the frequency eigenvector;

[0042] S323: Perform image vibration compensation processing using the updated parameter data to optimize image visibility and clarity, and output a vibration compensated image.

[0043] As a further solution of the present invention, the steps of dynamically adjusting the image contrast and sharpness are:

[0044] S411: importing the vibration compensated image, calculating the resolution of the compensated image, determining the accuracy of the image, and outputting the compensated image evaluation result;

[0045] S412: Based on the compensation image evaluation result, edge detection is performed on the vibration compensation image, and the scale line shape and position are automatically identified and measured to obtain scale line shape and position information;

[0046] S413: Dynamically adjust the contrast and sharpness of the image according to the shape and position information of the scale lines, using the formula:

[0047]

[0048] and

[0049]

[0050] Calculate the adjusted image contrast and sharpness , output the adjusted clear image, where , and is the adjustment coefficient, and are the contrast and sharpness of the original image, respectively.

[0051] As a further solution of the present invention, the steps of obtaining the high-precision ruler scale recognition result are:

[0052] S421: Based on the adjusted clear image, pattern recognition is performed, the scale lines in the image are analyzed, the features of each scale line are identified, and preliminary scale reading data is obtained;

[0053] S422: Compare the preliminary scale reading data with the standard scale database, calculate the deviation between the actual position and the theoretical position, and use the formula:

[0054]

[0055] Calculate the corrected reading , get the corrected exact reading, where, is a preliminary reading, is the deviation value, is the maximum allowed deviation threshold, used to correct reading deviation;

[0056] S423: Utilize the corrected exact readings to perform data analysis optimization, using the formula:

[0057]

[0058] Calculate the corrected standard deviation , evaluate the consistency of the corrected data and generate high-precision scale recognition results, where is the mth corrected reading, is the average of the corrected readings, It is the total number of readings and is used to assess the precision and reliability of the readings.

[0059] A high-precision ruler scale recognition system based on machine vision, the system includes:

[0060] The light reflection characteristic analysis module collects pixel coordinates and water scale coordinates in the actual scene, performs pixel-to-actual scale mapping, records the intensity and quality of the current ambient light in real time, analyzes the reflectivity of the scale lines under different lighting conditions, and generates the scale line light reflection characteristic analysis results;

[0061] The light source adjustment simulation module calculates the adjusted light source intensity based on the light reflection characteristic analysis results of the scale line, simulates the light source effect under different environmental conditions, verifies the applicability of the light source adjustment scheme, updates the light source intensity and angle in real time, and generates an adjusted light source model;

[0062] The image acquisition preprocessing module monitors the consistency between the actual illumination and the predetermined parameters based on the adjusted light source model, uses a camera to capture a continuous scale image sequence, performs a preliminary analysis on the continuous image sequence, calculates the visibility score of each frame of the image, and generates preprocessed image data;

[0063] The environmental vibration analysis module imports the pre-processed image data, performs initialization image analysis, observes the scale lines of each frame image, records each change instance data, compares the changes between frames, screens the environmental vibration caused by non-human operation, and generates environmental vibration recognition results;

[0064] The vibration compensation processing module extracts key vibration frequencies based on the environmental vibration recognition result, adjusts image processing parameters in real time, performs image vibration compensation processing, optimizes image visibility and clarity, and outputs a vibration compensated image;

[0065] The image adjustment and optimization module calculates the resolution of the compensated image based on the vibration compensated image, determines the accuracy of the image, automatically identifies and measures the shape and position of the scale lines, dynamically adjusts the contrast and sharpness of the image, and outputs the adjusted clear image;

[0066] The pattern recognition and deviation analysis module performs pattern recognition based on the adjusted clear image, analyzes the scale lines in the image, compares it with the standard scale database, calculates the deviation between the actual position and the theoretical position, performs data analysis optimization and calculates the corrected standard deviation, evaluates the consistency of the corrected data, and generates a high-precision scale recognition result.

[0067] Compared with the prior art, the advantages and positive effects of the present invention are:

[0068] In the present invention, the light source is finely adjusted to adapt to environmental changes, the clarity and consistency of the image under different lighting conditions are enhanced, the accuracy of the data is guaranteed, the scale lines in the image are deeply observed, and the image processing parameters are adjusted in real time through vibration feature analysis, which greatly reduces the image offset and distortion caused by environmental vibration, ensures the accuracy and stability of the measurement, and dynamically adjusts the image contrast and sharpness, calculates the exact scale reading according to the real-time image analysis results, improves the stability of the operation and the data processing speed, and significantly reduces the measurement deviation caused by environmental factors and mechanical errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a main step flow chart of the present invention;

[0070] Figure 2 is a flow chart for analyzing the reflection characteristics of the scale lines under differential illumination conditions of the present invention;

[0071] Figure 3 A flow chart for obtaining a light source model for adjusting the present invention;

[0072] Figure 4 This is a flowchart for obtaining preprocessed image data of the present invention;

[0073] Figure 5 This is a flow chart for identifying image offset and distortion of the present invention;

[0074] Figure 6 This is a flow chart of obtaining a vibration compensation image of the present invention;

[0075] Figure 7 The flowchart of the dynamic adjustment of image contrast and sharpness of the present invention;

[0076] Figure 8 This is a flow chart for obtaining high-precision ruler scale recognition results of the present invention. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0078] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.

[0079] See also Figure 1 , a high-precision ruler scale recognition method based on machine vision, comprising the following steps:

[0080] S1: Based on the calibrated pixel coordinates and the actual water level coordinates, an initial mathematical model is constructed to monitor the intensity and quality of the ambient light, analyze the reflection characteristics of the scale under different lighting conditions, and automatically adjust the light source intensity and angle according to the analysis results to match the changes in ambient light conditions and generate an adjusted light source model;

[0081] S2: Using the adjusted light source model, verify the adjusted lighting conditions, capture continuous image sequences through the camera, perform real-time analysis of the light intensity and scale line visibility for each frame of the image, and generate pre-processed image data;

[0082] S3: Based on the pre-processed image data, the scale lines in the continuously captured images are deeply observed to identify the image offset and distortion caused by the environmental vibration. According to the image offset and distortion identification results, the vibration characteristics are determined through high-frequency analysis, and the image processing parameters are adjusted in real time to compensate for the vibration and generate a vibration-compensated image.

[0083] S4: Analyze the shape and position of the scale lines using the vibration compensation image, dynamically adjust the image contrast and sharpness, calculate the exact scale reading based on the dynamic adjustment results, determine the actual position, adjust and optimize the final output reading based on the data, and obtain a high-precision scale recognition result.

[0084] Adjusting the light source model includes light source intensity configuration, light source angle configuration and ambient light matching mechanism; preprocessing image data includes visibility indicators; vibration compensation images include vibration frequency recognition results and offset correction data; high-precision scale recognition results include morphological accuracy analysis results, position accuracy analysis results and reading accuracy analysis results.

[0085] See also Figure 2 , the analysis steps of the reflective characteristics of the scale line under different lighting conditions are:

[0086] S111: by collecting pixel coordinates and water ruler coordinates in the actual scene, applying linear regression technology to build a coordinate conversion model, performing pixel to actual scale mapping, and generating a pixel to water ruler coordinate conversion model;

[0087] S112: Based on the pixel to water scale coordinate conversion model, the light sensor is used to record the intensity and quality of the current ambient light in real time, and the statistical analysis method is applied, using the formula:

[0088]

[0089] Calculate the average light intensity , generate ambient light quality monitoring results, where is the light intensity measured at a single time, is the total number of samples;

[0090] S113: Combined with the ambient light quality monitoring results, the reflectivity of the scale line under different lighting conditions is analyzed using the formula:

[0091]

[0092] Calculate the average reflectivity , generate the analysis results of the scale line light reflection characteristics, where Intensity A single reflectance measurement under and are adjustment factors representing the reflectance sensitivity and baseline offset, respectively.

[0093] Among them, the coordinate transformation model is constructed according to the formula , calculate the transformation model from pixel to water gauge coordinates. In the formula, represents the water gauge coordinate model, represents the linear regression coefficient, represents pixel coordinates, Represents the intercept of the regression model.

[0094] Using linear regression, the goal is to find the coefficients and the intercept , so that Best fit to the known data points.

[0095] There are the following data points: pixel coordinates , water scale coordinates , first calculate The average and The slope of the best fit line is then found and the intercept .

[0096] calculate and The average value of:

[0097]

[0098]

[0099] Calculate the slope:

[0100]

[0101]

[0102]

[0103] Compute the intercept:

[0104]

[0105] Therefore, the final conversion formula is:

[0106]

[0107] The results show that by applying the linear regression method, the water gauge coordinates can be accurately predicted from the pixel coordinates, providing a basis for further analysis and practical application.

[0108] Over a period of time, the following light intensity data points are collected: (Unit: Lux), First, calculate the sum of all measurements:

[0109]

[0110]

[0111] Calculate the average light intensity:

[0112]

[0113] The calculation results show that the average ambient light intensity during the monitoring period is 170 lux, which provides benchmark data for subsequent analysis of lighting quality and scale line reflection characteristics.

[0114] set up For different light intensities The reflectivity measurement values ​​of the scale lines below have the following data:

[0115] exist Under lux illumination, the corresponding reflectivity is:

[0116]

[0117] set up , , calculate the average reflectivity:

[0118]

[0119]

[0120]

[0121] The calculation results show that under given lighting conditions, the average reflectivity is 0.406, reflecting the reflective performance of the scale under the current lighting. This result is crucial for understanding and adjusting the visual recognition system of the scale to ensure that the scale can be accurately read under various lighting conditions.

[0122] See also Figure 3 , the steps to adjust the light source model are:

[0123] S121: Based on the analysis results of the light reflection characteristics of the scale lines, the formula is used:

[0124]

[0125] Calculate the adjusted light intensity , generate light source adjustment instructions, where, and is the adjustment factor;

[0126] S122: inputting a light source adjustment instruction, simulating the light source effect under different environmental conditions, verifying the applicability of the light source adjustment solution, and generating simulation test data;

[0127] S123: According to the simulation test data, actual light source control adjustment is performed, the light source intensity and angle are updated in real time to ensure matching with the ambient light conditions, and an adjustment light source model is generated.

[0128] Combined with the above calculation results, the ambient light intensity Lux, reflectivity ;

[0129] set up and , substitute into the formula to calculate:

[0130]

[0131] This indicates that under current environmental conditions, the light intensity should be adjusted to approximately 85.325 lux to provide the best visual effect.

[0132] Among them, input the light source intensity adjustment command into the optical simulation software, according to the formula , calculate the simulation test results. In the formula, Represents the simulation test results, , and Represents the parameters of the simulation environment, Represents the light intensity coefficient.

[0133] Combined with the above results Lux, setting , (Converted to radians ), (light scattering coefficient), (refractive index), substitute it into the formula and calculate:

[0134]

[0135]

[0136] Among them, the actual light source control is carried out according to the simulation test results, according to the formula , adjust the light source intensity and angle to generate the adjusted light source model. Represents the final light source model, Correction factor representing ambient light conditions.

[0137] Combined with the above results Lux, setting , calculate the adjusted light source model:

[0138]

[0139] The results show that the adjusted light source model should be set to approximately 95.9 lux to ensure that the light source output fully matches the ambient light conditions. Accurate adjustment ensures the best performance of the vision system in practical applications.

[0140] See also Figure 4 , the steps for obtaining preprocessed image data are:

[0141] S211: Based on the adjusted light source model, start the lighting condition verification, monitor the consistency between the actual lighting and the predetermined parameters, match the image capture standard, and generate the verified lighting condition data;

[0142] S212: Based on the verified illumination condition data, a continuous scale image sequence is captured using a camera, and a preliminary analysis is performed on the continuous image sequence to ensure that each frame meets a preset image quality standard, thereby generating a high-quality image sequence;

[0143] S213: Using high-quality image sequences, deep analysis is performed using the formula,

[0144]

[0145] Calculate the visibility score for each frame , accurately reflects the clarity and visibility of the image under the current lighting conditions, and generates pre-processed image data, where represents the average light intensity extracted from the image data, represents the average scale signal strength, is the weighting coefficient of light intensity, which is used to adjust the influence of light intensity in visibility score. is the weighting coefficient of the scale line signal strength, which is used to improve the contribution of scale line clarity to the visibility score. is a factor used to adjust the sensitivity of the overall visibility calculation.

[0146] Among them, the verification of lighting conditions is carried out according to the formula , calculate the consistency between the actual light intensity and the predetermined parameters, where, Represents the consistency score of the lighting conditions, Represents the light data obtained from the monitoring device, Represents a predetermined light intensity parameter.

[0147] Monitored light data Lux, the expected light intensity Lux.

[0148] Substitute into the formula to calculate the consistency score:

[0149]

[0150] The results show that the experimental conditions are in good agreement with the expected settings (with little deviation from 2502), indicating that the lighting conditions are suitable for high-quality image capture.

[0151] Among them, the continuous image sequence is preliminarily analyzed according to the formula , evaluate the illumination uniformity and the clarity of the scale lines of each frame. Represents the image quality score, represents the illumination uniformity data extracted from the image sequence, Represents the total number of images in the image sequence.

[0152] Get the cumulative value of illumination uniformity data , total number of images , substitute into the formula to calculate the image quality score:

[0153]

[0154] The results show that the image sequence has high illumination uniformity and scale line clarity, and the average quality score of each frame is 100, which is suitable for further detailed analysis.

[0155] Collect light intensity The average value obtained is 200 lux, the average scale line signal intensity is 0.8.

[0156] Weight coefficient setting:

[0157]

[0158]

[0159] Setting the normalization coefficient , is the benchmark value used to ensure that the scoring results are within a reasonable range.

[0160] Substitute into the formula and perform specific calculations:

[0161]

[0162]

[0163] The results show that considering the influence of lighting and scale lines, the visibility score of the image is about 1.006. This score reflects that under the current lighting and scale line conditions, the overall visibility of the image is good, which provides a good basis for subsequent image processing and analysis.

[0164] See also Figure 5 , the steps for identifying image shift and distortion are:

[0165] S311: importing pre-processed image data, performing initialization image analysis, and performing depth observation on continuously captured images; eliminating interference from external factors, and generating image sequence analysis initialization results;

[0166] S312: using the image sequence analysis initialization result, observing the scale line of each frame of the image, using edge detection and morphological transformation to identify the offset and distortion in the image, recording each change instance data, and generating image offset and distortion records;

[0167] S313: The image offset and distortion records are summarized and preliminarily evaluated, and the environmental vibration caused by non-human operation is screened by comparing the changes between frames to generate the environmental vibration recognition result.

[0168] In which, initialize the image analysis and apply the formula , calculate the initial parameter values ,in represents the resolution (number of pixels) of the preprocessed image, is the adjustment factor.

[0169] Image resolution (1920 1080, the total number of pixels is 2073600).

[0170] set up , substitute into the formula and calculate:

[0171]

[0172] The result means that the processing parameter value is 144, and the square root of the resolution is extracted using the square root sign, which is further scaled by adjusting the coefficient to ensure that the parameter is within a reasonable range to meet the system processing requirements.

[0173] Among them, image offset and distortion detection is performed using the formula , calculate the number of offset and distorted data points ,in Represents the number of edge points obtained by edge detection, is the transformation percentage.

[0174] (edge ​​detection 3000 edge points), (The transformation percentage is 10%).

[0175] Substitute into the formula and calculate:

[0176]

[0177] The results show that the calculated offset and distortion data are 300 points, indicating significant morphological changes and further analysis is needed to determine the impact of vibration.

[0178] Among them, the offset and distortion data are comprehensively analyzed and the formula is used. , calculate the image change caused by environmental vibration ,in, Represents the ambient vibration level.

[0179] Combined with the above results , set the ambient vibration level .

[0180] Substituting into the formula, we get:

[0181]

[0182] The results show that the image changes caused by environmental vibration are extremely large ( ), indicating that the vibration has a very serious impact on the image quality and compensation measures must be taken immediately.

[0183] See also Figure 6 , the steps to obtain the vibration compensation image are:

[0184] S321: Based on the environmental vibration identification results, Fourier transform is applied to extract key vibration frequencies using the formula:

[0185]

[0186] Determine and output frequency eigenvector ,in, Represents the image sequence Frame displacement data, Indicates the frame number. Represents the total number of image frames, is the complex exponential part of the Fourier transform, which converts the time series into a frequency series. Indicates plural, represents a real number;

[0187] S322: According to the frequency feature vector, the image processing parameters are adjusted in real time using the formula:

[0188]

[0189] Calculate the new parameter quantization value , get the updated parameter data, where represents the original parameter quantization value, To adjust the coefficients and ensure timely response to environmental vibrations, represents the maximum value in the frequency eigenvector;

[0190] S323: Perform image vibration compensation processing using the updated parameter data to optimize image visibility and clarity, and output a vibration compensated image.

[0191] Get a sequence of images As follows: [0.5, 0.7, -0.6, 0.2, -0.1], total number of frames .

[0192] Through Fourier transform, we can calculate :

[0193]

[0194]

[0195]

[0196]

[0197]

[0198] Through Fourier analysis, the vibration intensity at different frequencies can be obtained, which is helpful for subsequent vibration characteristic analysis.

[0199] Set the original parameter quantization value , adjustment coefficient .

[0200] Obtained from the above steps , substituting into the formula, we get:

[0201]

[0202] The results show that by analyzing the vibration frequency of the image, it is necessary to appropriately adjust the image processing parameters (1.5 times the original parameters, for example, if the image brightness needs to be adjusted and the original brightness value is 1, then the value needs to be adjusted to 1.5) to adapt to the impact of vibration and thus optimize the stability and clarity of the image.

[0203] Finally, the image compensation processing is performed according to the adjusted parameters to obtain the vibration compensated image.

[0204] See also Figure 7 , the steps for dynamic adjustment of image contrast and sharpness are:

[0205] S411: importing the vibration compensation image, calculating the resolution of the compensated image, determining the accuracy of the image, and outputting the compensation image evaluation result;

[0206] S412: Based on the compensation image evaluation result, edge detection is performed on the vibration compensation image, and the scale line shape and position are automatically identified and measured to obtain scale line shape and position information;

[0207] S413: Dynamically adjust the contrast and sharpness of the image according to the shape and position information of the scale lines, using the formula:

[0208]

[0209] and

[0210]

[0211] Calculate the adjusted image contrast and sharpness , output the adjusted clear image, where, , and is the adjustment coefficient, and are the contrast and sharpness of the original image, respectively.

[0212] Among them, after importing the vibration compensation image, according to the formula , calculate the resolution of the image In the formula, represents the width of the image in pixels, Represents the height of the image in pixels.

[0213] Determine the image width is 1920 pixels, height For 1080 pixels, the calculation process is as follows:

[0214]

[0215] The results show that the image has a resolution of 2,073,600 pixels, which means that the image is fine enough for accurate edge detection in visual analysis, which helps in the accurate identification of scale lines.

[0216] Among them, the edge detection of the image is performed according to the formula , calculate the percentage of edges in the image , where represents the resolution of the image (pixels), is the total number of edge pixels.

[0217] The total number of edge pixels after edge detection is 154,000 pixels, and the calculation process is as follows:

[0218]

[0219] The results show that approximately 7.43% of the pixels in the image belong to the edge, which means that the scale lines of the image have been successfully highlighted, providing accurate basic data for the scale line morphology and position analysis in subsequent steps.

[0220] Collecting original contrast ,set up =1.5, =0.05Calculation as follows:

[0221]

[0222]

[0223] The results show that the adjusted contrast is 0.8, which means that the contrast of the image is enhanced, making the details in the image more obvious and facilitating subsequent scale recognition.

[0224] is the sharpness index of the original image, which is 0.3. It can significantly improve the edge clarity of the image. Substitute into the formula to calculate:

[0225]

[0226]

[0227] The results show that the adjusted sharpness index is 0.655, which is a significant improvement compared to the original sharpness, helping the edge detection algorithm to more accurately identify the edges of the scale lines.

[0228] See also Figure 8 , the steps to obtain high-precision ruler scale recognition results are:

[0229] S421: Based on the adjusted clear image, pattern recognition is performed, the scale lines in the image are analyzed, the features of each scale line are identified, and preliminary scale reading data is obtained;

[0230] S422: Compare the preliminary scale reading data with the standard scale database, calculate the deviation between the actual position and the theoretical position, and use the formula:

[0231]

[0232] Calculate the corrected reading , get the corrected exact reading, where, is a preliminary reading, is the deviation value, is the maximum allowed deviation threshold, used to correct reading deviation;

[0233] S423: Using the corrected exact readings, perform data analysis optimization using the formula:

[0234]

[0235] Calculate the corrected standard deviation , evaluate the consistency of the corrected data and generate high-precision scale recognition results, where is the mth corrected reading, is the average of the corrected readings, It is the total number of readings and is used to assess the precision and reliability of the readings.

[0236] Among them, the scale line feature recognition in the image is based on the formula , calculate the characteristic frequency In the formula, Represents the number of tick marks that are successfully identified. Represents the total number of tick marks in the image.

[0237] In an image containing 100 scale lines, pattern recognition can successfully identify 90 of them, then . is the total number of scale lines in the image. For the same image, .

[0238] Substituting into the formula, we get:

[0239]

[0240] The results show that the recognition rate is 90%, indicating that the application of pattern recognition technology in this case shows a high efficiency, which is sufficient for subsequent accurate measurement and data processing.

[0241] Represents the initial reading obtained from image analysis, one scale is read as 20.5 cm.

[0242] It is the deviation obtained by comparing with the standard data. The standard data is 20cm, so the reading is 0.5cm higher. .

[0243] is the maximum allowed deviation threshold, set to 1.0cm, indicating the maximum tolerated deviation.

[0244] Substituting into the formula, we get:

[0245]

[0246] The results show that the reading after deviation adjustment is 14.0 cm, indicating that the impact of the original error is appropriately reduced and the actual accuracy of the reading is improved.

[0247] It is a single corrected reading. The series of readings obtained from the correction steps are: 13.9cm, 14.1cm, 14.0cm.

[0248] is the average of the corrected readings, calculated as cm.

[0249] is the total number of readings, .

[0250] Substitute into the formula and calculate:

[0251]

[0252]

[0253]

[0254] The results show that the standard deviation of the corrected reading set is cm, showing that the correction measures brought about a high degree of consistency in the data, effectively increasing the reliability of the readings.

[0255] A high-precision ruler scale recognition system based on machine vision, comprising:

[0256] The light reflection characteristic analysis module collects pixel coordinates and water scale coordinates in the actual scene, performs pixel-to-actual scale mapping, records the intensity and quality of the current ambient light in real time, analyzes the reflectivity of the scale lines under different lighting conditions, and generates the scale line light reflection characteristic analysis results;

[0257] The light source adjustment simulation module calculates the adjusted light source intensity based on the analysis results of the light reflection characteristics of the scale lines, simulates the light source effect under different environmental conditions, verifies the applicability of the light source adjustment plan, updates the light source intensity and angle in real time, and generates an adjusted light source model;

[0258] The image acquisition preprocessing module is based on adjusting the light source model, monitoring the consistency between the actual illumination and the predetermined parameters, using a camera to capture a continuous scale image sequence, and performing a preliminary analysis on the continuous image sequence, calculating the visibility score of each frame of the image, and generating preprocessed image data;

[0259] The environmental vibration analysis module imports the pre-processed image data, performs initialization image analysis, observes the scale lines of each frame image, records each change instance data, compares the changes between frames, screens the environmental vibration caused by non-human operation, and generates environmental vibration recognition results;

[0260] The vibration compensation processing module extracts key vibration frequencies based on the environmental vibration recognition results, adjusts image processing parameters in real time, performs image vibration compensation processing, optimizes image visibility and clarity, and outputs vibration compensated images;

[0261] The image adjustment and optimization module calculates the resolution of the compensated image based on the vibration compensation image, determines the accuracy of the image, automatically identifies and measures the shape and position of the scale lines, dynamically adjusts the contrast and sharpness of the image, and outputs the adjusted clear image;

[0262] The pattern recognition and deviation analysis module performs pattern recognition based on the adjusted clear image, analyzes the scale lines in the image, compares it with the standard scale database, calculates the deviation between the actual position and the theoretical position, performs data analysis optimization and calculates the corrected standard deviation, evaluates the consistency of the corrected data, and generates high-precision scale recognition results.

[0263] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A high-precision scale recognition method based on machine vision, characterized in that: The following steps are involved: Based on the calibrated pixel coordinates and the actual water level coordinates, an initial mathematical model is constructed to monitor the intensity and quality of ambient light, analyze the reflection characteristics of the scale under different lighting conditions, and automatically adjust the light source intensity and angle according to the analysis results to match the changes in ambient light conditions and generate an adjusted light source model; The adjusted light source model is used to verify the adjusted lighting conditions, a continuous image sequence is captured by a camera, and the light intensity and scale line visibility of each frame of the image are analyzed in real time to generate pre-processed image data; Based on the pre-processed image data, the scale lines in the continuously captured images are observed in depth to identify image offset and distortion caused by environmental vibration, and vibration characteristics are determined through high-frequency analysis according to the image offset and distortion identification results, and image processing parameters are adjusted in real time to perform vibration compensation to generate a vibration compensated image; Utilizing the vibration-compensated image, analyzing the shape and position of the scale lines, dynamically adjusting the image contrast and sharpness, calculating the exact scale reading based on the dynamic adjustment result, determining the actual position, adjusting and optimizing the final output reading based on the data, and obtaining a high-precision scale recognition result; The analysis steps of the reflective characteristics of the scale lines under differential illumination conditions are as follows: By collecting pixel coordinates and water ruler coordinates in the actual scene, the linear regression technology is used to build a coordinate transformation model, perform pixel to actual scale mapping, and generate a pixel to water ruler coordinate transformation model; Based on the pixel-to-scale coordinate conversion model, a light sensor is used to record the intensity and quality of the current ambient light in real time, and a statistical analysis method is applied, using the formula: Calculate the average light intensity , generate ambient light quality monitoring results, where is the light intensity measured at a single time, is the total number of samples; Combined with the ambient light quality monitoring results, the reflectivity of the scale lines under different lighting conditions is analyzed, and the formula is used: Calculate the average reflectivity , generate the analysis results of the scale line light reflection characteristics, where Intensity A single reflectance measurement under and are adjustment factors, representing the sensitivity of reflectance and baseline offset, respectively; The steps of obtaining the adjusted light source model are: Based on the analysis results of the light reflection characteristics of the scale lines, the formula is adopted: Calculate the adjusted light intensity , generate light source adjustment instructions, where, and is the adjustment factor; Input the light source adjustment instruction, simulate the light source effect under different environmental conditions, verify the applicability of the light source adjustment plan, and generate simulation test data; According to the simulation test data, actual light source control adjustment is performed, the light source intensity and angle are updated in real time to ensure matching with ambient light conditions, and an adjustment light source model is generated.

2. The high-precision ruler scale recognition method based on machine vision according to claim 1 is characterized in that: The steps of obtaining the preprocessed image data are as follows: Based on the adjusted light source model, start the lighting condition verification, monitor the consistency of actual lighting with predetermined parameters, match the image capture standard, and generate verified lighting condition data; Based on the verified illumination condition data, a continuous scale image sequence is captured using a camera, and a preliminary analysis is performed on the continuous image sequence to ensure that each frame meets a preset image quality standard and generate a high-quality image sequence; Using the high-quality image sequence, a depth analysis is performed using the formula: Calculate the visibility score for each frame , accurately reflects the clarity and visibility of the image under the current lighting conditions, and generates pre-processed image data, where represents the average light intensity extracted from the image data, represents the average scale signal strength, is the weighting coefficient of light intensity, which is used to adjust the influence of light intensity in visibility score. is the weighting coefficient of the scale line signal strength, which is used to improve the contribution of scale line clarity to the visibility score. is a factor used to adjust the sensitivity of the overall visibility calculation.

3. The high-precision ruler scale recognition method based on machine vision according to claim 2 is characterized in that: The steps for identifying image offset and distortion are: Import the pre-processed image data, perform initialization image analysis, and perform in-depth observation on the continuously captured images; eliminate interference from external factors and generate image sequence analysis initialization results; Utilizing the image sequence analysis initialization result, observing the scale lines of each frame of the image, using edge detection and morphological transformation to identify the offset and distortion in the image, recording each change instance data, and generating image offset and distortion records; The image shift and distortion records are summarized and preliminarily evaluated, and environmental vibrations caused by non-human operations are screened by comparing changes between frames to generate environmental vibration recognition results.

4. The high-precision ruler scale recognition method based on machine vision according to claim 3 is characterized in that: The steps of acquiring the vibration compensation image are: Based on the environmental vibration recognition results, Fourier transform is applied to extract key vibration frequencies using the formula: Determine and output frequency eigenvector ,in, Represents the image sequence Frame displacement data, Indicates the frame number. Represents the total number of image frames, is the complex exponential part of the Fourier transform, which converts the time series into a frequency series. Indicates plural, represents a real number; According to the frequency feature vector, the image processing parameters are adjusted in real time using the formula: Calculate the new parameter quantization value , get the updated parameter data, where represents the original parameter quantization value, To adjust the coefficients and ensure timely response to environmental vibrations, represents the maximum value in the frequency eigenvector; The updated parameter data is used to perform image vibration compensation processing, optimize image visibility and clarity, and output a vibration compensated image.

5. The high-precision ruler scale recognition method based on machine vision according to claim 4 is characterized in that: The steps of dynamically adjusting the image contrast and sharpness are as follows: Importing the vibration compensated image, calculating the resolution of the compensated image, determining the accuracy of the image, and outputting the compensated image evaluation result; Based on the compensation image evaluation result, edge detection is performed on the vibration compensation image, and the scale line shape and position are automatically identified and measured to obtain scale line shape and position information; According to the morphology and position information of the scale lines, the contrast and sharpness of the image are dynamically adjusted using the formula: and Calculate the adjusted image contrast and sharpness , output the adjusted clear image, where, , and is the adjustment coefficient, and are the contrast and sharpness of the original image, respectively.

6. The high-precision ruler scale recognition method based on machine vision according to claim 5 is characterized in that: The steps for obtaining the high-precision ruler scale recognition result are: Based on the adjusted clear image, pattern recognition is performed to analyze the scale lines in the image, identify the features of each scale line, and obtain preliminary scale reading data; The preliminary scale reading data is compared with the standard scale database, and the deviation between the actual position and the theoretical position is calculated using the formula: Calculate the corrected reading , get the corrected exact reading, where, is a preliminary reading, is the deviation value, is the maximum allowed deviation threshold, used to correct reading deviation; Using the corrected exact readings, data analysis was optimized using the formula: Calculate the corrected standard deviation , evaluate the consistency of the corrected data and generate high-precision scale recognition results, where It is Corrected readings, is the average of the corrected readings, It is the total number of readings and is used to assess the precision and reliability of the readings.

7. A high-precision scale recognition system based on machine vision, characterized in that: According to the high-precision ruler scale recognition method based on machine vision according to any one of claims 1 to 6, the system comprises: The light reflection characteristic analysis module collects pixel coordinates and water scale coordinates in the actual scene, performs pixel-to-actual scale mapping, records the intensity and quality of the current ambient light in real time, analyzes the reflectivity of the scale lines under different lighting conditions, and generates the scale line light reflection characteristic analysis results; The light source adjustment simulation module calculates the adjusted light source intensity based on the light reflection characteristic analysis results of the scale line, simulates the light source effect under different environmental conditions, verifies the applicability of the light source adjustment scheme, updates the light source intensity and angle in real time, and generates an adjusted light source model; The image acquisition preprocessing module monitors the consistency between the actual illumination and the predetermined parameters based on the adjusted light source model, uses a camera to capture a continuous scale image sequence, performs a preliminary analysis on the continuous image sequence, calculates the visibility score of each frame of the image, and generates preprocessed image data; The environmental vibration analysis module imports the pre-processed image data, performs initialization image analysis, observes the scale lines of each frame image, records each change instance data, compares the changes between frames, screens the environmental vibration caused by non-human operation, and generates environmental vibration recognition results; The vibration compensation processing module extracts key vibration frequencies based on the environmental vibration recognition result, adjusts image processing parameters in real time, performs image vibration compensation processing, optimizes image visibility and clarity, and outputs a vibration compensated image; The image adjustment and optimization module calculates the resolution of the compensated image based on the vibration compensated image, determines the accuracy of the image, automatically identifies and measures the shape and position of the scale lines, dynamically adjusts the contrast and sharpness of the image, and outputs the adjusted clear image; The pattern recognition and deviation analysis module performs pattern recognition based on the adjusted clear image, analyzes the scale lines in the image, compares it with the standard scale database, calculates the deviation between the actual position and the theoretical position, performs data analysis optimization and calculates the corrected standard deviation, evaluates the consistency of the corrected data, and generates a high-precision scale recognition result.