An absolute linear position detection system and method based on image recognition
By using an absolute linear position detection system based on multi-scale filtering and directional gradient consistency rules for image recognition, the problems of decreased accuracy and insufficient anti-interference ability in existing technologies are solved, and high-precision and stable linear position detection is achieved.
Patent Information
- Application Number
- CN202511236613.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing absolute linear position detection technology suffers from decreased accuracy and insufficient anti-interference capability under complex working conditions, making it difficult to meet the requirements of high-precision applications, and lacks an effective error compensation mechanism.
An absolute linear position detection system based on image recognition is adopted, including data acquisition, multi-scale filtering, directional gradient consistency rule feature extraction and error compensation correction. Multi-scale filtering improves image quality, and combined with directional gradient consistency rules and error compensation mechanisms, high-precision linear position detection is achieved.
It significantly improves the accuracy and stability of linear position detection, can output high-precision linear position information, is suitable for complex working conditions, and improves the reliability and applicability of detection technology.
Smart Images

Figure CN120747230B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an absolute linear position detection system and method based on image recognition. Background Technology
[0002] In the field of absolute linear position detection, traditional detection technologies often rely on contact sensors or single optical recognition schemes. These technologies have significant limitations when facing complex working conditions. Contact detection is prone to accuracy degradation over time due to mechanical wear and is sensitive to environmental conditions such as dust and humidity, making it difficult to operate stably in harsh environments. Single optical recognition schemes are limited by the anti-interference capability of image acquisition. When the surface of the object being measured has uneven lighting, stains, or minor scratches, image feature extraction is easily distorted, resulting in large deviations in position detection results, which cannot meet the requirements of high-precision application scenarios.
[0003] Meanwhile, existing non-contact image recognition and detection methods face a trade-off between efficiency and accuracy in image processing and feature analysis. Most methods use fixed-scale filtering to process the original image, making it difficult to simultaneously suppress image noise and preserve structured edge features. This results in insufficient accuracy in locating key feature points during subsequent gradient direction analysis and position encoding. Furthermore, the lack of effective error compensation mechanisms in absolute position encoding and physical position calibration fails to eliminate periodic deviations caused by systematic errors. Ultimately, the absolute accuracy and stability of the detection results cannot meet the stringent requirements for linear position detection in scenarios such as precision control of industrial equipment and positioning in high-end manufacturing, thus hindering its widespread application in high-precision fields. Summary of the Invention
[0004] This invention provides an absolute linear position detection system and method based on image recognition to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides an absolute linear position detection system based on image recognition, characterized in that the system includes a data acquisition module, an image processing module, a feature extraction module, an encoding linkage module, and a position determination module, wherein:
[0006] The data acquisition module is used to acquire raw image data of linear position features on the surface of the object under test;
[0007] The image processing module is used to perform multi-scale filtering on the original image data to obtain an enhanced image with structured edge features in the original image data;
[0008] The feature extraction module is used to extract features from the enhanced image based on the directional gradient consistency rule to obtain the location encoding information feature value of the enhanced image;
[0009] The encoding linkage module is used to perform a relational mapping between the encoding and decoding of the linear position features based on the spatial distribution pattern of the position encoding information feature values, so as to obtain the absolute position encoding value of the enhanced image.
[0010] The position determination module is used to calibrate the relationship between the absolute position encoding value and the physical position of the surface of the object to be measured, so as to obtain high-precision linear position information of the surface of the object to be measured.
[0011] In a preferred embodiment, when acquiring raw image data of linear positional features on the surface of the object under test, the data acquisition module is specifically used for:
[0012] A frontal image of the surface of the object to be tested is acquired to obtain an initial image frame of the surface of the object to be tested.
[0013] Based on the initial image frame, the exposure parameters of the linear position features are adaptively adjusted to obtain a processed image with uniform brightness on the surface of the object under test.
[0014] Geometric distortion correction is performed on the image to be processed to obtain the corrected original image data.
[0015] In a preferred embodiment, when the image processing module performs multi-scale filtering on the original image data to obtain an enhanced image with structured edge features in the original image data, it is specifically used for:
[0016] The original image data is subjected to Gaussian filtering at the first scale to obtain a smoothed base image of the original image data.
[0017] The original image data is subjected to bilateral filtering at the second scale to obtain an edge-preserving image of the original image data.
[0018] The smooth base image and the edge-preserving image are weighted and fused to obtain an intermediate image of the original image data;
[0019] Edge enhancement processing is performed on the intermediate image to obtain an enhanced image of the original image data.
[0020] In a preferred embodiment, when the image processing module performs weighted fusion of the smoothed base image and the edge-preserving image to obtain an intermediate image of the original image data, it is specifically used for:
[0021] Calculate the local gradient magnitude of each pixel in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image;
[0022] Adaptive weight matching is performed on the gradient magnitude distribution map to obtain the adaptive weight coefficients of the gradient magnitude distribution map;
[0023] Based on the adaptive weighting coefficients, a function is constructed on the smoothed base image and the edge-preserving image to obtain the pixel-level fusion function of the gradient magnitude distribution map;
[0024] Based on the pixel-level fusion function, the smooth base image and the edge-preserving image are weighted and calculated to obtain an intermediate image of the original image data. The calculation formula for the intermediate image is as follows:
[0025]
[0026] In the formula, For the intermediate image in Pixel value at coordinates For the smooth base image in Pixel value at coordinates To preserve the image at the edges Pixel value at coordinates The adaptive weighting coefficients are those for the gradient magnitude distribution map.
[0027] In a preferred embodiment, when the image processing module calculates the local gradient magnitude of pixels in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image, it is specifically used for:
[0028] The gradient component matrix of the edge-preserving image is obtained by performing gradient differentiation processing in the horizontal and vertical directions on the edge-preserving image.
[0029] Based on the gradient component matrix, the gradient components of the pixels are synthesized to obtain the initial gradient magnitude map of the edge-preserving image. The calculation formula of the initial gradient magnitude map is as follows:
[0030]
[0031] In the formula, The initial gradient magnitude map at pixel points gradient magnitude at that point Preserve the horizontal gradient component of the image for the edges. Preserve the vertical gradient component of the image for the edges. It is the stabilization constant;
[0032] The initial gradient magnitude map is localized to obtain the standardized gradient magnitude distribution of the initial gradient magnitude map;
[0033] The normalized gradient magnitude distribution is nonlinearly enhanced to obtain the gradient magnitude distribution map of the edge-preserving image.
[0034] In a preferred embodiment, when the feature extraction module extracts features from the enhanced image based on the directional gradient consistency rule to obtain the location encoding information feature values of the enhanced image, it is specifically used for:
[0035] Gradient direction analysis is performed on the enhanced image to obtain the gradient direction field of the enhanced image;
[0036] Based on the directional gradient consistency rule, the gradient direction field is subjected to region consistency discrimination to obtain the feature region of consistent gradient direction in the enhanced image;
[0037] The center point of the feature region is located to obtain the key feature points of the feature region;
[0038] Based on preset encoding rules, the key feature points are encoded and parsed to obtain the location encoding information feature values of the enhanced image.
[0039] In a preferred embodiment, when the encoding linkage module performs a relational mapping on the encoding and decoding of the linear position features based on the spatial distribution pattern of the position encoding information feature values to obtain the absolute position encoding value of the enhanced image, it is specifically used for:
[0040] Spatial distribution analysis is performed on the feature values of the location encoding information to obtain the relative positional relationships of the feature points in the feature values of the location encoding information.
[0041] Based on the relative positional relationship, the spatial distribution of feature points is spatially registered with the preset coding template to obtain a spatial relationship table of the relative positional relationship.
[0042] Based on the spatial relationship table, the linear position features are encoded and identified to obtain the encoded sequence of the linear position features;
[0043] The mapping relationship between the encoded sequence and the absolute position is parsed to obtain the absolute position encoded value of the enhanced image.
[0044] In a preferred embodiment, when the position determination module calibrates the relationship between the absolute position encoding value and the physical position of the surface of the object under test to obtain high-precision linear position information of the surface of the object under test, it is specifically used for:
[0045] The absolute position encoding value is analyzed by the encoding sequence of the actual physical location to obtain the correspondence table of the absolute position encoding value;
[0046] Based on the correspondence table, the absolute position code value is transformed by position mapping to obtain the preliminary position data of the absolute position code value;
[0047] The preliminary location data is interpolated and optimized to obtain refined location information.
[0048] Error compensation correction is performed on the refined position information to obtain high-precision linear position information of the surface of the object under test.
[0049] In a preferred embodiment, when the position determination module performs error compensation correction on the refined position information to obtain high-precision linear position information of the surface of the object to be measured, it is specifically used for:
[0050] A systematic error analysis was performed on the refining location information to obtain the periodic deviation pattern of the refining location information;
[0051] The periodic deviation pattern is subjected to parameter extraction to obtain the error compensation parameters of the periodic deviation pattern;
[0052] Based on the error compensation parameters, the refined position information is subjected to deviation correction processing to obtain high-precision linear position information of the surface of the object to be measured.
[0053] To address the above problems, the present invention also provides an absolute linear position detection method based on image recognition, the method comprising:
[0054] S1. Acquire raw image data of linear positional features on the surface of the object to be tested;
[0055] S2. Perform multi-scale filtering on the original image data to obtain an enhanced image with structured edge features in the original image data;
[0056] S3. Based on the orientation gradient consistency rule, feature extraction is performed on the enhanced image to obtain the position encoding information feature value of the enhanced image;
[0057] S4. Based on the spatial distribution pattern of the feature values of the location coding information, perform a relational mapping on the encoding and decoding of the linear location features to obtain the absolute location coding value of the enhanced image;
[0058] S5. The relationship between the absolute position encoding value and the physical position of the surface of the object to be measured is calibrated to obtain high-precision linear position information of the surface of the object to be measured.
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] 1. This invention uses multi-scale filtering to process raw image data, effectively combining the advantages of smooth base images and edge-preserving images. It also achieves precise suppression of image noise and enhancement of structured edge features, laying a high-quality image foundation for the subsequent extraction of location coding information feature values. This significantly improves the preprocessing effect of linear location feature images, ensuring that clearer and more accurate key feature information can be obtained in subsequent feature extraction stages.
[0061] 2. In the feature extraction and position calibration stages, this invention relies on the directional gradient consistency rule to achieve accurate localization of key feature points. It combines the spatial distribution law of the feature values of position encoding information to complete the encoding and decoding relationship mapping. At the same time, through interpolation optimization and error compensation correction mechanisms, the preliminary position data is refined and the deviation is corrected, effectively eliminating the periodic deviation caused by system errors. Finally, it can output high-precision linear position information of the surface of the object under test, which greatly improves the accuracy and stability of absolute linear position detection and further enhances the reliability and applicability of image recognition-based absolute linear position detection technology in practical applications. Attached Figure Description
[0062] Figure 1 A system architecture diagram of an absolute linear position detection system based on image recognition provided in an embodiment of the present invention;
[0063] Figure 2 This is a flowchart illustrating an absolute linear position detection method based on image recognition, provided in an embodiment of the present invention.
[0064] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments belong to some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “said” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.
[0067] Depending on the context, the word "if" or "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0068] Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0069] In practice, the server-side equipment deployed in an image recognition-based absolute linear position detection system may consist of one or more devices. This image recognition-based absolute linear position detection system can be implemented as a business instance, a virtual machine, or hardware devices. For example, it can be implemented as a business instance deployed on one or more devices in a cloud node. Simply put, it can be understood as software deployed on a cloud node, providing image recognition-based absolute linear position detection to various user terminals. Alternatively, it can be implemented as a virtual machine deployed on one or more devices in a cloud node, with application software installed to manage each user terminal. Or, it can also be implemented as a server composed of numerous identical or different types of hardware devices, with one or more hardware devices configured to provide image recognition-based absolute linear position detection to various user terminals.
[0070] In terms of implementation, an image recognition-based absolute linear position detection system and a user client are mutually compatible. Specifically, if the image recognition-based absolute linear position detection system is implemented as an application installed on a cloud service platform, the user client acts as a client establishing a communication connection with that application; or if the image recognition-based absolute linear position detection system is implemented as a website, the user client acts as a webpage; or if the image recognition-based absolute linear position detection system is implemented as a cloud service platform, the user client acts as a mini-program within an instant messaging application.
[0071] like Figure 1 The figure shown is a system architecture diagram of an absolute linear position detection system based on image recognition provided in an embodiment of the present invention.
[0072] The absolute linear position detection system 100 based on image recognition described in this invention can be installed on a cloud server. In terms of implementation, it can be used as one or more service devices, or as an application installed in the cloud (e.g., a mobile service operator's server, server cluster, etc.), or it can be developed into a website. Depending on the functions implemented, the absolute linear position detection system 100 based on image recognition may include a data acquisition module 101, an image processing module 102, a feature extraction module 103, an encoding linkage module 104, and a position determination module 105. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, stored in the memory of the electronic device.
[0073] In this embodiment of the invention, in an absolute linear position detection system based on image recognition, each of the above modules can be implemented independently and can call other modules. Here, "calling" can be understood as one module connecting to multiple modules of another type and providing corresponding services to those connected modules. In the absolute linear position detection system based on image recognition provided by this embodiment of the invention, the applicability of the system architecture can be adjusted by adding modules and directly calling them without modifying the program code, achieving cluster-based horizontal expansion to quickly and flexibly expand the system. In practical applications, the above modules can be set in the same device or different devices, or they can be set in a virtual device, such as a service instance in a cloud server.
[0074] The following describes, with reference to specific embodiments, each component and its specific workflow of an absolute linear position detection system based on image recognition:
[0075] The data acquisition module 101 is used to acquire raw image data of linear position features on the surface of the object to be tested;
[0076] In this embodiment of the invention, when the data acquisition module acquires raw image data of linear positional features on the surface of the object under test, it is specifically used for:
[0077] A frontal image of the surface of the object to be tested is acquired to obtain an initial image frame of the surface of the object to be tested.
[0078] Based on the initial image frame, the exposure parameters of the linear position features are adaptively adjusted to obtain a processed image with uniform brightness on the surface of the object under test.
[0079] Geometric distortion correction is performed on the image to be processed to obtain the corrected original image data.
[0080] Specifically, when acquiring a frontal image of the surface of the object to be tested, the object is first fixed in a preset position on the image acquisition platform to ensure that the surface of the object is perpendicular to the lens of the acquisition device and within the effective shooting range of the lens. Then, the acquisition device is started, and the acquisition device performs a complete image capture of the surface of the object according to the preset initial working mode. After the capture is completed, the acquisition device directly outputs the image obtained in this capture, which is the initial image frame of the surface of the object to be tested.
[0081] Furthermore, when adaptively adjusting the exposure parameters of the linear position feature based on the initial image frame, the image region corresponding to the linear position feature is first identified from the initial image frame. By scanning the pixels in the region line by line, the brightness of each pixel is observed to determine whether there are overly bright or overly dark parts in the region. If there are overly bright parts, the exposure time of the acquisition device is reduced; if there are overly dark parts, the exposure time of the acquisition device is increased. During the adjustment process, the brightness change of the linear position feature region is continuously observed until the brightness of all pixels in the region tends to be consistent. At this time, the adjusted exposure parameters are used to acquire the image of the object surface again. The acquired image is the image to be processed with uniform brightness on the surface of the object to be tested.
[0082] Furthermore, when performing geometric distortion correction on the image to be processed, multiple reference points with obvious features are first selected in the image to be processed. The positions of these reference points on the surface of the actual object are known and accurate. Then, the actual coordinates of each reference point in the image to be processed are compared with the ideal coordinates calculated based on the position on the surface of the actual object to determine the positional deviation of each reference point caused by geometric distortion. Then, based on these positional deviations, the pixel arrangement of the image is adjusted, and each pixel is moved from the current distorted position to the corresponding ideal position. The image obtained after the adjustment is the corrected original image data.
[0083] In summary, the data acquisition module directly acquires the initial image frame of the object under test by frontal image acquisition, and then adaptively adjusts the exposure parameters of the linear position feature based on the initial image frame. This can accurately optimize the image brightness, making the brightness of the obtained image to be processed uniform, providing stable basic image data for subsequent image processing, and effectively reducing the interference of uneven brightness on the recognition of linear position features.
[0084] In summary, geometric distortion correction of a uniformly bright image can eliminate geometric deviations caused by equipment or shooting angle during image acquisition, ensuring that the final raw image data can accurately reflect the spatial distribution of linear position features on the surface of the object under test. This provides an accurate image source for subsequent multi-scale filtering, feature extraction, and other steps, improving the accuracy of linear position detection from the source of acquisition.
[0085] The image processing module 102 is used to perform multi-scale filtering on the original image data to obtain an enhanced image of the structured edge features in the original image data;
[0086] In this embodiment of the invention, when the image processing module performs multi-scale filtering on the original image data to obtain an enhanced image with structured edge features in the original image data, it is specifically used for:
[0087] The original image data is subjected to Gaussian filtering at the first scale to obtain a smoothed base image of the original image data.
[0088] The original image data is subjected to bilateral filtering at the second scale to obtain an edge-preserving image of the original image data.
[0089] The smooth base image and the edge-preserving image are weighted and fused to obtain an intermediate image of the original image data;
[0090] Edge enhancement processing is performed on the intermediate image to obtain an enhanced image of the original image data.
[0091] When the image processing module performs weighted fusion of the smooth base image and the edge-preserving image to obtain an intermediate image of the original image data, it is specifically used for:
[0092] Calculate the local gradient magnitude of each pixel in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image;
[0093] Adaptive weight matching is performed on the gradient magnitude distribution map to obtain the adaptive weight coefficients of the gradient magnitude distribution map;
[0094] Based on the adaptive weighting coefficients, a function is constructed on the smoothed base image and the edge-preserving image to obtain the pixel-level fusion function of the gradient magnitude distribution map;
[0095] Based on the pixel-level fusion function, the smooth base image and the edge-preserving image are weighted and calculated to obtain an intermediate image of the original image data. The calculation formula for the intermediate image is as follows:
[0096]
[0097] In the formula, For the intermediate image in Pixel value at coordinates For the smooth base image in Pixel value at coordinates To preserve the image at the edges Pixel value at coordinates The adaptive weighting coefficients are those for the gradient magnitude distribution map.
[0098] When the image processing module calculates the local gradient magnitude of pixels in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image, it is specifically used for:
[0099] The gradient component matrix of the edge-preserving image is obtained by performing gradient differentiation processing in the horizontal and vertical directions on the edge-preserving image.
[0100] Based on the gradient component matrix, the gradient components of the pixels are synthesized to obtain the initial gradient magnitude map of the edge-preserving image. The calculation formula of the initial gradient magnitude map is as follows:
[0101]
[0102] In the formula, The initial gradient magnitude map at pixel points gradient magnitude at that point Preserve the horizontal gradient component of the image for the edges. Preserve the vertical gradient component of the image for the edges. It is the stabilization constant;
[0103] The initial gradient magnitude map is localized to obtain the standardized gradient magnitude distribution of the initial gradient magnitude map;
[0104] The normalized gradient magnitude distribution is nonlinearly enhanced to obtain the gradient magnitude distribution map of the edge-preserving image.
[0105] Specifically, when performing Gaussian filtering on the first scale of the original image data, the image range corresponding to the first scale is first determined. This range covers the entire area of the original image data. Then, each pixel within this range is processed one by one. When processing each pixel, a certain number of neighboring pixels are selected around the pixel as the center. The color values of these neighboring pixels are combined with the color value of the center pixel for calculation. During the calculation, the neighboring pixels closer to the center pixel have a greater influence on the result, while the neighboring pixels farther away have a smaller influence on the result. The color value of the original center pixel is replaced with the calculated new color value. After all pixels have been processed, the resulting image is the smoothed base image of the original image data.
[0106] Furthermore, when performing bilateral filtering on the second scale of the original image data, the image range corresponding to the second scale is first determined. This range focuses on the areas in the original image data where edges may exist. Then, each pixel within this range is processed one by one. When processing each pixel, a certain number of neighboring pixels are selected around the pixel as the center. In the process of calculating the new color value, not only the distance between the neighboring pixels and the center pixel is considered, but their color differences are also compared. When the color difference between the neighboring pixels and the center pixel is large, the influence of the neighboring pixels on the result is reduced. When the color difference is small, the influence of the distance is considered normally. The color value of the original center pixel is replaced with the calculated new color value. After all pixels are processed, the resulting image is the edge-preserving image of the original image data.
[0107] Furthermore, when performing weighted fusion of the smooth base image and the edge-preserving image, the smooth base image and the edge-preserving image are placed in the same coordinate system, so that each pixel of the two images corresponds one-to-one. Then, for each corresponding pixel, the color value of the pixel in the smooth base image and the color value of the pixel in the edge-preserving image are extracted respectively, and fixed weights are assigned to these two color values. The weight of the smooth base image is used to preserve its overall smoothness characteristics, and the weight of the edge-preserving image is used to preserve its edge information. The two color values are multiplied by their corresponding weights and then added together. The result is used as the color value of the pixel at that position in the fused image. When all pixels have completed the fusion calculation, the resulting image is the intermediate image of the original image data.
[0108] Furthermore, when performing edge enhancement processing on the intermediate image, the color difference between each pixel in the intermediate image and its neighboring pixels is checked one by one. When it is found that the color difference between a pixel and its neighboring pixels exceeds a set limit, it is determined that there is an edge at that position. For areas with edges, the color difference between the pixels on both sides of the edge is increased. Specifically, the pixels with darker colors on one side of the edge are made darker, and the pixels with lighter colors on the other side are made lighter. For areas without edges, the color values of the pixels are kept unchanged. After such processing, the edge features in the image are clearer and more prominent, and the resulting image is the enhanced image of the original image data.
[0109] Specifically, when calculating the local gradient magnitude of pixels in the edge-preserving image, each pixel in the edge-preserving image is selected one by one. Taking each pixel as the center, the pixels adjacent to it in the four directions of up, down, left, and right are observed. The color difference between the center pixel and each adjacent pixel is compared. These color differences are combined to obtain a value, which represents the intensity of the color change of the pixel in the local area. After all pixels have been calculated, the values corresponding to each pixel are arranged according to their positions in the image. The resulting image is the gradient magnitude distribution map of the edge-preserving image.
[0110] Furthermore, when performing adaptive weight matching on the gradient magnitude distribution map, the range of gradient magnitude is first determined, which covers the values of all pixels in the gradient magnitude distribution map. This range is then divided into multiple consecutive intervals, each interval corresponding to a fixed weight coefficient. The interval with smaller gradient magnitude corresponds to a larger weight coefficient, and the interval with larger gradient magnitude corresponds to a smaller weight coefficient. Then, each pixel in the gradient magnitude distribution map is checked one by one, and a corresponding weight coefficient is assigned to it according to the interval to which the gradient magnitude value of the pixel belongs. After all pixels have been assigned, the resulting image containing the weight coefficient corresponding to each pixel is the adaptive weight coefficient of the gradient magnitude distribution map.
[0111] Furthermore, based on the adaptive weight coefficients, when constructing the function for the smooth base image and the edge-preserving image, the weight value of each pixel in the adaptive weight coefficients is associated with the color value of the corresponding pixel in the smooth base image. At the same time, the result of subtracting the weight value from 1 is associated with the color value of the corresponding pixel in the edge-preserving image. A correspondence is established between these two association results and the final fused pixel color value, so that for any pixel in the image, the fused color value can be obtained through the weight value of that position, the color value of the smooth base image, and the color value of the edge-preserving image. This correspondence is the pixel-level fusion function of the gradient magnitude distribution map.
[0112] Furthermore, based on the pixel-level fusion function, when performing weighted calculations on the smooth base image and the edge-preserving image, the smooth base image and the edge-preserving image are placed in the same coordinate system, so that the pixels of the two images correspond one-to-one. For each corresponding pixel, the color value of the pixel in the smooth base image, the color value of the pixel in the edge-preserving image, and the weight value of the position in the adaptive weight coefficient are extracted. According to the requirements of the pixel-level fusion function, the weight value is multiplied by the color value of the smooth base image, and the result of subtracting the weight value from 1 is multiplied by the color value of the edge-preserving image. The two products are added together, and the result is used as the color value of the fused pixel at that position. When all pixels at all positions have been calculated, the resulting image is the intermediate image of the original image data.
[0113] Specifically, when performing gradient differentiation processing on the edge-preserving image in the horizontal and vertical directions, the horizontal direction is processed first. The color difference between each pixel in the edge-preserving image and its right-side neighboring pixel is examined one by one, and these difference values are recorded according to the pixel position to form the gradient data in the horizontal direction. Then, the vertical direction is processed. The color difference between each pixel and its lower-side neighboring pixel is examined one by one, and these difference values are recorded according to the position to form the gradient data in the vertical direction. The two parts of data are combined together and arranged into a matrix according to the arrangement order of the image pixels. The resulting matrix is the gradient component matrix of the edge-preserving image.
[0114] Furthermore, based on the gradient component matrix, when performing amplitude synthesis on the gradient components of the pixels, the horizontal and vertical gradient data corresponding to each pixel are extracted from the gradient component matrix. The gradient data in these two directions are processed separately to convert them into non-negative values. Then, these two non-negative values are merged into a new value. This new value can comprehensively reflect the degree of color change of the pixel in both the horizontal and vertical directions. At the same time, in order to avoid extreme cases, a fixed small value is added during the merging process to ensure that the final value remains stable. After all pixels have completed this processing, the resulting image is the initial gradient amplitude map of the edge-preserving image.
[0115] Furthermore, when performing local region normalization on the initial gradient magnitude map, the initial gradient magnitude map is divided into multiple non-overlapping small regions. Each small region contains a certain number of adjacent pixels. For each small region, the maximum and minimum values of the gradient magnitude of all pixels within it are found, and the range of the gradient magnitude within that region is calculated. Then, each pixel within the small region is processed one by one. The minimum value within the region is subtracted from the gradient magnitude of the pixel, and then divided by the range within the region to obtain a new value. This new value can reflect the relative degree of change of the pixel within the local region. After all pixels in all small regions have been processed, the resulting image is the normalized gradient magnitude distribution of the initial gradient magnitude map.
[0116] Furthermore, when performing nonlinear enhancement on the standardized gradient magnitude distribution, the value of each pixel in the standardized gradient magnitude distribution is examined one by one. For pixels with larger values, their values are appropriately increased to make the areas of drastic color change represented by the pixel more prominent. For pixels with smaller values, their values are appropriately decreased to make the areas of gentle color change represented by the pixel less obvious. Through this processing, the difference between areas of drastic color change and areas of gentle color change in the image becomes more significant. The image obtained after processing is the gradient magnitude distribution map of the edge-preserving image.
[0117] In summary, the image processing module performs multi-scale filtering on the original image data, applying Gaussian filtering and bilateral filtering respectively. This enables precise suppression of image noise and complete preservation of structured edge features simultaneously, resulting in an image with both a smooth base and clear edge information. This lays a high-quality image foundation for subsequent feature extraction and significantly improves the preprocessing effect of linear position feature images.
[0118] In summary, weighted fusion of smooth base images and edge-preserving images, followed by further edge enhancement of intermediate images, can strengthen the structured edge features in the original image data, making the linear position features in the enhanced image clearer and more prominent. This ensures that subsequent feature extraction steps can obtain more accurate key feature information, thereby improving the accuracy of absolute linear position detection from the image processing level.
[0119] In summary, the image processing module generates a gradient magnitude distribution map by calculating the local gradient magnitude of pixels in the edge-preserving image, and performs adaptive weight matching accordingly. This allows the weight coefficients to accurately adapt to the feature differences of different regions of the image, ensuring that when constructing the pixel-level fusion function, the noise suppression advantage of the smooth base image and the edge information advantage of the edge-preserving image can be selectively preserved, thereby improving the adaptability and accuracy of image fusion.
[0120] In summary, by performing weighted calculations on the smooth base image and the edge-preserving image based on a pixel-level fusion function and using a formula to achieve fine-grained fusion at the pixel level, the intermediate image can achieve an optimal combination of smoothness characteristics and edge features at each coordinate point. This ensures the overall smoothness of the image without losing key structured edge information, providing a high-quality intermediate image for subsequent edge enhancement processing and further solidifying the image foundation for linear position detection.
[0121] In summary, the image processing module performs gradient differentiation processing on the edge-preserving image in the horizontal and vertical directions, which can comprehensively capture the gradient changes of pixels in the image in two key directions. The generated gradient component matrix provides complete data support for subsequent gradient magnitude calculation. Then, the initial gradient magnitude map is synthesized by formula. The introduction of stabilization constant can avoid extreme cases in the calculation process, ensuring the stability and accuracy of the initial gradient magnitude map, and laying a reliable foundation for subsequent gradient magnitude distribution optimization.
[0122] In summary, local region normalization of the initial gradient magnitude map can eliminate the magnitude differences of gradient magnitudes in different regions, resulting in a standardized gradient magnitude distribution. Further nonlinear enhancement processing can strengthen the characteristic differences of gradient magnitudes, enabling the final gradient magnitude distribution map to more clearly and accurately reflect the local change patterns of pixels in the edge-preserving image. This provides high-quality feature data for subsequent adaptive weight matching and improves the accuracy of image fusion.
[0123] The feature extraction module 103 is used to extract features from the enhanced image based on the orientation gradient consistency rule to obtain the position encoding information feature value of the enhanced image;
[0124] In this embodiment of the invention, when the feature extraction module extracts features from the enhanced image based on the directional gradient consistency rule to obtain the location encoding information feature values of the enhanced image, it is specifically used for:
[0125] Gradient direction analysis is performed on the enhanced image to obtain the gradient direction field of the enhanced image;
[0126] Based on the directional gradient consistency rule, the gradient direction field is subjected to region consistency discrimination to obtain the feature region of consistent gradient direction in the enhanced image;
[0127] The center point of the feature region is located to obtain the key feature points of the feature region;
[0128] Based on preset encoding rules, the key feature points are encoded and parsed to obtain the location encoding information feature values of the enhanced image.
[0129] Specifically, when performing gradient direction analysis on the enhanced image, the color changes of each pixel in the enhanced image and its surrounding neighboring pixels are examined one by one to determine the direction of the most obvious color change at each pixel. This direction is the gradient direction of that pixel. The gradient directions of all pixels are recorded one by one according to their positions in the image to form an overall distribution that can intuitively show the direction of color change at each position in the image. This distribution is the gradient direction field of the enhanced image.
[0130] Furthermore, based on the directional gradient consistency rule, when performing region consistency discrimination on the gradient direction field, a starting pixel is selected from the gradient direction field, the gradient direction of the pixel is observed, and then the gradient directions of its surrounding neighboring pixels are checked. It is determined whether the gradient directions of these neighboring pixels are similar to the gradient direction of the starting pixel. If they are similar, these pixels are classified into the same region, and the process continues to expand to check the neighboring pixels of other pixels in the region. The above judgment process is repeated until no new pixels that meet the conditions can be added to the region. Other unclassified pixels in the image are processed in the same way. Finally, each region composed of pixels with similar gradient directions is the feature region of consistent gradient direction in the enhanced image.
[0131] Furthermore, when locating the center point of the feature region, first determine the coordinate positions of all pixels contained in each feature region in the image, find the maximum and minimum values of the horizontal position among these coordinates, calculate the midpoint of these two values as the horizontal center position of the feature region, then find the maximum and minimum values of the vertical position, calculate the midpoint of these two values as the vertical center position of the feature region, and combine the horizontal center position and the vertical center position to obtain the coordinate point as the key feature point of the feature region.
[0132] Furthermore, when encoding and parsing the key feature points based on preset encoding rules, the preset encoding rules refer to the regulations for converting the coordinate positions of the key feature points in the image into specific character or number combinations. According to these regulations, the horizontal coordinate values of the key feature points are first extracted and converted into corresponding characters or numbers. Then, the vertical coordinate values of the key feature points are extracted and converted into corresponding characters or numbers. Finally, the two conversion results are combined in a preset order to form information that can uniquely represent the position of the key feature point. This information is the position encoding information feature value of the enhanced image.
[0133] In summary, the feature extraction module generates a gradient direction field by performing gradient direction analysis on the enhanced image, and then completes the region consistency judgment according to the direction gradient consistency rule. It can accurately screen out feature regions with consistent gradient directions in the enhanced image, ensuring that the subsequent center point localization stage can focus on the effective linear position feature region, reduce interference from irrelevant regions, improve the accuracy of key feature point localization, and provide an accurate feature basis for the extraction of feature values of position encoding information.
[0134] In summary, center point localization of the feature region can clarify the core location of key feature points. Combining the preset coding rules to encode and parse the key feature points can transform the spatial location information of the key feature points into standardized location coding information feature values, ensuring that the feature extraction results can be directly used in subsequent coding linkage steps. At the same time, by normalizing the gradient magnitude distribution through local region normalization and nonlinear enhancement processing, feature differences are further strengthened, providing clearer feature basis for feature extraction and improving the accuracy and reliability of linear position detection from the feature parsing level.
[0135] The encoding linkage module 104 is used to perform relational mapping on the encoding and decoding of the linear position features based on the spatial distribution law of the position encoding information feature values, so as to obtain the absolute position encoding value of the enhanced image.
[0136] In this embodiment of the invention, when the encoding linkage module performs a relational mapping on the encoding and decoding of the linear position features based on the spatial distribution pattern of the position encoding information feature values to obtain the absolute position encoding value of the enhanced image, it is specifically used for:
[0137] Spatial distribution analysis is performed on the feature values of the location encoding information to obtain the relative positional relationships of the feature points in the feature values of the location encoding information.
[0138] Based on the relative positional relationship, the spatial distribution of feature points is spatially registered with the preset coding template to obtain a spatial relationship table of the relative positional relationship.
[0139] Based on the spatial relationship table, the linear position features are encoded and identified to obtain the encoded sequence of the linear position features;
[0140] The mapping relationship between the encoded sequence and the absolute position is parsed to obtain the absolute position encoded value of the enhanced image.
[0141] Specifically, when performing spatial distribution analysis on the location-encoded information feature values, the coordinates of the key feature points corresponding to each location-encoded information feature value in the image are extracted one by one. These coordinates are arranged in order, and then the horizontal and vertical distances between every two key feature points are calculated. The orientation and distance relationships of each feature point relative to all other feature points are recorded. Through these orientation and distance relationships, the spatial arrangement and mutual positional relationships of each feature point are clarified. The overall set of these relationships is the relative positional relationship of the feature points in the location-encoded information feature values.
[0142] Furthermore, based on the relative positional relationship, when performing spatial position registration between the spatial distribution of feature points and the preset encoding template, the preset encoding template is a template containing a standard feature point arrangement pattern and relative position parameters. The relative positional relationship of the feature points is compared with the standard pattern in the preset encoding template, and the overall position and angle of the feature points in space are adjusted so that the spatial distribution of the feature points coincides with the standard pattern in the preset encoding template as much as possible. When the degree of coincidence between the two reaches the set requirement, the standard position corresponding to each feature point in the preset encoding template is recorded. The summary of these correspondences is the spatial relationship table of the relative positional relationship.
[0143] Furthermore, when encoding and recognizing the linear position features based on the spatial relationship table, the encoding symbol corresponding to each feature point in the preset encoding template is determined according to the correspondence between the feature points in the spatial relationship table and the standard positions of the preset encoding template. These encoding symbols are arranged sequentially according to the linear arrangement order of the feature points in the image to form a continuous symbol sequence. This sequence can completely reflect the encoding information of the linear position features, which is the encoding sequence of the linear position features.
[0144] Furthermore, when performing encoding parsing on the mapping relationship between the encoded sequence and the absolute position, a correspondence table between the encoded sequence and the absolute position is pre-established. Each encoded sequence in the correspondence table uniquely corresponds to an absolute position information. The encoded sequence of the obtained linear position feature is compared with the encoded sequence in the correspondence table to find a completely matching encoded sequence. Then, the absolute position information associated with the encoded sequence in the correspondence table is extracted. This information is the absolute position encoded value of the enhanced image.
[0145] In summary, the coding linkage module performs spatial distribution analysis on the feature values of location coding information, which can accurately capture the relative positional relationship between feature points and provide accurate feature association basis for subsequent spatial location registration. Based on this relative positional relationship, it performs registration with the preset coding template and generates a spatial relationship table, which can achieve accurate alignment of feature point distribution with the standard coding pattern, ensure the directionality and accuracy of linear position feature coding recognition, and lay a reliable foundation for coding sequence extraction.
[0146] In summary, relying on spatial relationship tables to encode and identify linear position features can generate complete and accurate coding sequences. By parsing the mapping relationship between the coding sequence and the absolute position, the absolute position coding value can be obtained, which can transform the spatial information of feature points into standardized absolute position codes. This ensures that the coding results can be directly used for subsequent physical position calibration, guaranteeing the accuracy of absolute linear position detection from the coding mapping level and providing key support for finally obtaining high-precision linear position information.
[0147] The position determination module 105 is used to calibrate the relationship between the absolute position encoding value and the physical position of the surface of the object to be measured, so as to obtain high-precision linear position information of the surface of the object to be measured.
[0148] In this embodiment of the invention, when the position determination module calibrates the relationship between the absolute position encoding value and the physical position of the surface of the object under test to obtain high-precision linear position information of the surface of the object under test, it is specifically used for:
[0149] The absolute position encoding value is analyzed by the encoding sequence of the actual physical location to obtain the correspondence table of the absolute position encoding value;
[0150] Based on the correspondence table, the absolute position code value is transformed by position mapping to obtain the preliminary position data of the absolute position code value;
[0151] The preliminary location data is interpolated and optimized to obtain refined location information.
[0152] Error compensation correction is performed on the refined position information to obtain high-precision linear position information of the surface of the object under test.
[0153] The position determination module performs error compensation and correction on the refined position information to obtain high-precision linear position information of the surface of the object under test, specifically for:
[0154] A systematic error analysis was performed on the refining location information to obtain the periodic deviation pattern of the refining location information;
[0155] The periodic deviation pattern is subjected to parameter extraction to obtain the error compensation parameters of the periodic deviation pattern;
[0156] Based on the error compensation parameters, the refined position information is subjected to deviation correction processing to obtain high-precision linear position information of the surface of the object to be measured.
[0157] Specifically, when performing coding sequence analysis on the absolute position coding value for the actual physical position, all possible absolute position coding values and their corresponding actual physical positions on the surface of the object to be measured are collected. These actual physical positions are directly acquired and recorded by measuring tools. Each absolute position coding value is matched one-to-one with its corresponding actual physical position and arranged in a table in order. Each row in the table contains an absolute position coding value and its corresponding actual physical position information. This table is the correspondence table of the absolute position coding values.
[0158] Furthermore, when performing position mapping conversion on the absolute position code value based on the correspondence table, the currently obtained absolute position code value is searched in the correspondence table, the row where the code value is located is found, the actual physical position information recorded in the row is extracted, and this information is directly used as the position data after the absolute position code value is converted. Since the position data obtained at this time is the basic data directly obtained from the correspondence table and has not yet been optimized, it is called the preliminary position data of the absolute position code value.
[0159] Furthermore, when interpolating and optimizing the preliminary location data, other known precise physical location data existing around the preliminary location data are examined. These data are spatially adjacent to the preliminary location data. Several known precise location data that are closest to the preliminary location data are selected. The distribution pattern of these data is referenced to adjust the preliminary location data so that the adjusted location data better matches the distribution trend of the actual physical location and reduces the error caused by discrete sampling. The location information obtained after such adjustment is the refined location information of the preliminary location data.
[0160] Furthermore, when performing error compensation correction on the refined position information, the types and values of fixed errors that may occur during the measurement and calculation process are predetermined. These errors include system errors of the equipment itself, errors caused by environmental factors, etc. The values of these fixed errors are deducted or offset from the refined position information. At the same time, based on the random error patterns that appear in historical measurement data, the refined position information is fine-tuned to further eliminate deviations caused by accidental factors. The position information obtained after these processes is the high-precision linear position information of the surface of the object to be measured.
[0161] Specifically, when performing gradient direction analysis on the enhanced image, the color changes of each pixel in the enhanced image and its surrounding neighboring pixels are examined one by one to determine the direction of the most obvious color change at each pixel. This direction is the gradient direction of that pixel. The gradient directions of all pixels are recorded one by one according to their positions in the image to form an overall distribution that can intuitively show the direction of color change at each position in the image. This distribution is the gradient direction field of the enhanced image.
[0162] Furthermore, based on the directional gradient consistency rule, when performing region consistency discrimination on the gradient direction field, a starting pixel is selected from the gradient direction field, the gradient direction of the pixel is observed, and then the gradient directions of its surrounding neighboring pixels are checked. It is determined whether the gradient directions of these neighboring pixels are similar to the gradient direction of the starting pixel. If they are similar, these pixels are classified into the same region, and the process continues to expand to check the neighboring pixels of other pixels in the region. The above judgment process is repeated until no new pixels that meet the conditions can be added to the region. Other unclassified pixels in the image are processed in the same way. Finally, each region composed of pixels with similar gradient directions is the feature region of consistent gradient direction in the enhanced image.
[0163] Furthermore, when locating the center point of the feature region, first determine the coordinate positions of all pixels contained in each feature region in the image, find the maximum and minimum values of the horizontal position among these coordinates, calculate the midpoint of these two values as the horizontal center position of the feature region, then find the maximum and minimum values of the vertical position, calculate the midpoint of these two values as the vertical center position of the feature region, and combine the horizontal center position and the vertical center position to obtain the coordinate point as the key feature point of the feature region.
[0164] Furthermore, when encoding and parsing the key feature points based on preset encoding rules, the preset encoding rules refer to the regulations for converting the coordinate positions of the key feature points in the image into specific character or number combinations. According to these regulations, the horizontal coordinate values of the key feature points are first extracted and converted into corresponding characters or numbers. Then, the vertical coordinate values of the key feature points are extracted and converted into corresponding characters or numbers. Finally, the two conversion results are combined in a preset order to form information that can uniquely represent the position of the key feature point. This information is the position encoding information feature value of the enhanced image.
[0165] In summary, the location determination module generates a corresponding relationship table by analyzing the encoding sequence of the absolute location encoding value and the actual physical location, which can establish a precise association between the absolute location encoding and the physical location. Based on this table, the location mapping conversion of the absolute location encoding value is completed, and preliminary location data can be directly obtained, ensuring the accuracy of the location data conversion and providing standardized and reliable initial data support for subsequent location information optimization.
[0166] In summary, interpolating and optimizing the initial position data can improve the precision of the position information and obtain refined position information that better reflects the actual physical location. Further error compensation and correction of the refined position information can eliminate the deviation caused by systematic errors, and finally output high-precision linear position information of the surface of the object under test. The position calibration and optimization process ensures the absolute accuracy and stability of the detection results and improves the overall reliability of absolute linear position detection.
[0167] In summary, the location determination module performs systematic error analysis on refined location information, accurately capturing periodic deviation patterns and clarifying the rules and characteristics of the deviations, providing targeted directions for subsequent error correction. By extracting parameters from the periodic deviation patterns, the deviation patterns can be transformed into specific error compensation parameters, giving error correction a clear and quantifiable basis and improving the accuracy of error processing.
[0168] In summary, by performing deviation correction processing on the refined position information based on error compensation parameters, the periodic deviation caused by systematic errors can be directly eliminated, making the final linear position information more closely match the actual physical position of the surface of the object under test. This significantly improves the absolute accuracy of linear position detection, ensures that the high-precision linear position information output meets the stringent requirements of scenarios such as precision control and high-end manufacturing positioning, and enhances the reliability of practical applications of detection technology.
[0169] Reference Figure 2 The diagram shown is a flowchart illustrating an absolute linear position detection method based on image recognition according to an embodiment of the present invention. In this embodiment, the absolute linear position detection method based on image recognition includes:
[0170] S1. Acquire raw image data of linear positional features on the surface of the object to be tested;
[0171] S2. Perform multi-scale filtering on the original image data to obtain an enhanced image with structured edge features in the original image data;
[0172] S3. Based on the orientation gradient consistency rule, feature extraction is performed on the enhanced image to obtain the position encoding information feature value of the enhanced image;
[0173] S4. Based on the spatial distribution pattern of the feature values of the location coding information, perform a relational mapping on the encoding and decoding of the linear location features to obtain the absolute location coding value of the enhanced image;
[0174] S5. The relationship between the absolute position encoding value and the physical position of the surface of the object to be measured is calibrated to obtain high-precision linear position information of the surface of the object to be measured.
[0175] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0176] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. An absolute linear position detection system based on image recognition, characterized in that, The system includes a data acquisition module, an image processing module, a feature extraction module, an encoding linkage module, and a location determination module, wherein: The data acquisition module is used to acquire raw image data of linear position features on the surface of the object under test; The image processing module is used to perform multi-scale filtering on the original image data to obtain an enhanced image of the structured edge features in the original image data, including: The original image data is subjected to Gaussian filtering at the first scale to obtain a smoothed base image of the original image data. The original image data is subjected to bilateral filtering at the second scale to obtain an edge-preserving image of the original image data. The smooth base image and the edge-preserving image are weighted and fused to obtain an intermediate image of the original image data; The intermediate image is subjected to edge enhancement processing to obtain an enhanced image of the original image data; The feature extraction module is used to extract features from the enhanced image based on the directional gradient consistency rule to obtain the location encoding information feature value of the enhanced image; The encoding linkage module is used to perform a relational mapping between the encoding and decoding of the linear position features based on the spatial distribution pattern of the position encoding information feature values, so as to obtain the absolute position encoding value of the enhanced image. The position determination module is used to calibrate the relationship between the absolute position encoding value and the physical position of the surface of the object under test, to obtain high-precision linear position information of the surface of the object under test, including: The absolute position encoding value is analyzed by the encoding sequence of the actual physical location to obtain the correspondence table of the absolute position encoding value; Based on the correspondence table, the absolute position code value is transformed by position mapping to obtain the preliminary position data of the absolute position code value; The preliminary location data is interpolated and optimized to obtain refined location information. Error compensation and correction are performed on the refined position information to obtain high-precision linear position information of the surface of the object under test, including: A systematic error analysis was performed on the refining location information to obtain the periodic deviation pattern of the refining location information; The periodic deviation pattern is subjected to parameter extraction to obtain the error compensation parameters of the periodic deviation pattern; Based on the error compensation parameters, the refined position information is subjected to deviation correction processing to obtain high-precision linear position information of the surface of the object to be measured.
2. The absolute linear position detection system based on image recognition as described in claim 1, characterized in that, When acquiring raw image data of linear positional features on the surface of the object under test, the data acquisition module is specifically used for: A frontal image of the surface of the object to be tested is acquired to obtain an initial image frame of the surface of the object to be tested. Based on the initial image frame, the exposure parameters of the linear position features are adaptively adjusted to obtain a processed image with uniform brightness on the surface of the object under test. Geometric distortion correction is performed on the image to be processed to obtain the corrected original image data.
3. The absolute linear position detection system based on image recognition as described in claim 1, characterized in that, When the image processing module performs weighted fusion of the smooth base image and the edge-preserving image to obtain an intermediate image of the original image data, it is specifically used for: Calculate the local gradient magnitude of each pixel in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image; Adaptive weight matching is performed on the gradient magnitude distribution map to obtain the adaptive weight coefficients of the gradient magnitude distribution map; Based on the adaptive weighting coefficients, a function is constructed on the smoothed base image and the edge-preserving image to obtain the pixel-level fusion function of the gradient magnitude distribution map; Based on the pixel-level fusion function, the smooth base image and the edge-preserving image are weighted and calculated to obtain an intermediate image of the original image data. The calculation formula for the intermediate image is as follows: ; In the formula, For the intermediate image in Pixel value at coordinates For the smooth base image in Pixel value at coordinates To preserve the image at the edges Pixel value at coordinates The adaptive weighting coefficients are those for the gradient magnitude distribution map.
4. The absolute linear position detection system based on image recognition as described in claim 3, characterized in that, When the image processing module calculates the local gradient magnitude of pixels in the edge-preserving image to obtain the gradient magnitude distribution map of the edge-preserving image, it is specifically used for: The gradient component matrix of the edge-preserving image is obtained by performing gradient differentiation processing in the horizontal and vertical directions on the edge-preserving image. Based on the gradient component matrix, the gradient components of the pixels are synthesized to obtain the initial gradient magnitude map of the edge-preserving image. The calculation formula of the initial gradient magnitude map is as follows: ; In the formula, The initial gradient magnitude map at pixel points gradient magnitude at that point Preserve the horizontal gradient component of the image for the edges. Preserve the vertical gradient component of the image for the edges. It is the stabilization constant; The initial gradient magnitude map is localized to obtain the standardized gradient magnitude distribution of the initial gradient magnitude map; The normalized gradient magnitude distribution is nonlinearly enhanced to obtain the gradient magnitude distribution map of the edge-preserving image.
5. The absolute linear position detection system based on image recognition as described in claim 1, characterized in that, When the feature extraction module extracts features from the enhanced image based on the directional gradient consistency rule to obtain the location encoding information feature values of the enhanced image, it is specifically used for: Gradient direction analysis is performed on the enhanced image to obtain the gradient direction field of the enhanced image; Based on the directional gradient consistency rule, the gradient direction field is subjected to region consistency discrimination to obtain the feature region of consistent gradient direction in the enhanced image; The center point of the feature region is located to obtain the key feature points of the feature region; Based on preset encoding rules, the key feature points are encoded and parsed to obtain the location encoding information feature values of the enhanced image.
6. The absolute linear position detection system based on image recognition as described in claim 1, characterized in that, When the encoding linkage module performs a relational mapping between the encoding and decoding of the linear position features based on the spatial distribution pattern of the position encoding information feature values to obtain the absolute position encoding value of the enhanced image, it is specifically used for: Spatial distribution analysis is performed on the feature values of the location encoding information to obtain the relative positional relationships of the feature points in the feature values of the location encoding information. Based on the relative positional relationship, the spatial distribution of feature points is spatially registered with the preset coding template to obtain a spatial relationship table of the relative positional relationship. Based on the spatial relationship table, the linear position features are encoded and identified to obtain the encoded sequence of the linear position features; The mapping relationship between the encoded sequence and the absolute position is parsed to obtain the absolute position encoded value of the enhanced image.
7. An absolute linear position detection method based on image recognition, characterized in that, The method includes: S1. Acquire raw image data of linear positional features on the surface of the object to be tested; S2. Perform multi-scale filtering on the original image data to obtain an enhanced image of the structured edge features in the original image data, including: The original image data is subjected to Gaussian filtering at the first scale to obtain a smoothed base image of the original image data. The original image data is subjected to bilateral filtering at the second scale to obtain an edge-preserving image of the original image data. The smooth base image and the edge-preserving image are weighted and fused to obtain an intermediate image of the original image data; The intermediate image is subjected to edge enhancement processing to obtain an enhanced image of the original image data; S3. Based on the orientation gradient consistency rule, feature extraction is performed on the enhanced image to obtain the position encoding information feature value of the enhanced image; S4. Based on the spatial distribution pattern of the feature values of the location coding information, perform a relational mapping on the encoding and decoding of the linear location features to obtain the absolute location coding value of the enhanced image; S5. The relationship between the absolute position encoding value and the physical position of the surface of the object under test is calibrated to obtain high-precision linear position information of the surface of the object under test, including: The absolute position encoding value is analyzed by the encoding sequence of the actual physical location to obtain the correspondence table of the absolute position encoding value; Based on the correspondence table, the absolute position code value is transformed by position mapping to obtain the preliminary position data of the absolute position code value; The preliminary location data is interpolated and optimized to obtain refined location information. Error compensation and correction are performed on the refined position information to obtain high-precision linear position information of the surface of the object under test, including: A systematic error analysis was performed on the refining location information to obtain the periodic deviation pattern of the refining location information; The periodic deviation pattern is subjected to parameter extraction to obtain the error compensation parameters of the periodic deviation pattern; Based on the error compensation parameters, the refined position information is subjected to deviation correction processing to obtain high-precision linear position information of the surface of the object to be measured.
Citation Information
Patent Citations
Object orientation detection method and device, computer equipment and storage medium
CN119359809A
X-ray image reconstruction method based on direction perception tensor modeling
CN120525988A