Encoder disc baseline detection system

By combining a high-speed image sensor and an image processing module, the problems of low efficiency and poor real-time performance in encoder code disk installation are solved, achieving efficient and accurate baseline detection and improving the real-time performance and accuracy of the installation system.

CN117078616BActive Publication Date: 2026-01-09INST OF SEMICONDUCTORS - CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311013961.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2026-01-09
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

In the current technology, manual observation of eccentricity during encoder code disk installation is inefficient and lacks real-time performance. Image processing methods have low frame rates and cannot achieve real-time feedback control, resulting in insufficient installation accuracy and efficiency.

Method used

By employing a high-speed image sensor module, a morphological filtering module, a baseline segmentation module, and a baseline feature extraction module, combined with a caching module, real-time image acquisition, processing, and transmission are achieved. Through operations such as dilation erosion, image subtraction, erosion dilation, Gaussian filtering, gradient calculation, maximum suppression segmentation, and connected component feature extraction, the detection accuracy and real-time performance of baseline features are improved.

Benefits of technology

It improves the efficiency and accuracy of encoder code disk installation, reduces baseline position acquisition delay, and enhances the real-time performance and integration of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117078616B_ABST
    Figure CN117078616B_ABST
Patent Text Reader

Abstract

The application provides an encoder code disc baseline detection system, comprising: a high-speed image sensor module for acquiring an original image of an encoder code disc baseline; a morphological filtering module for preprocessing the original image; a baseline segmentation module for screening baseline features of the preprocessed image, a baseline feature extraction module for extracting baseline features of the image; and a cache module for realizing caching of a to-be-processed image in an image processing operation process. Through the high-speed image sensor module, the various image processing modules and the cache module inside the system, the collection, processing and transmission operations of the encoder code disc baseline image are completed, the baseline position acquisition delay of the entire encoder code disc installation system is reduced, the precision of the encoder code disc installation system is improved, and the application can be widely applied to the field of industrial manufacturing intelligentization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of intelligent industrial manufacturing, and particularly relates to an encoder code disc baseline detection system. BACKGROUND

[0002] The encoder code disc is an important component of a motor encoder. High-precision detection and control of position and speed in a high-speed motor require the motor encoder to accurately feed back the rotating position of the motor shaft. The motor encoder calculates the position and speed of the motor shaft by detecting the number of changes in code tracks on the code disc installed on the motor shaft. When the motor rotates at high speed, the degree of radial eccentricity of the code disc greatly affects the accuracy and stability of the angle detection of the encoder.

[0003] In order to reduce the eccentricity between the encoder code disc and the motor shaft during installation, the traditional installation method is to manually observe the baseline on the code disc through a microscope and adjust the position of the code disc while observing the eccentricity. Since manual observation cannot accurately measure the eccentricity, this installation method has low efficiency and installation accuracy. A new technology in recent years is to indirectly calculate the eccentric angle and distance of the code disc by least square fitting the baseline on the code disc image captured by an industrial camera that can collect images when the motor rotates to different angles. However, since the collected images need to be transmitted to an upper computer for processing, this method has low real-time performance and processing frame rate, and the detected baseline data cannot be used as real-time data for feedback control of the entire eccentricity adjustment system. Therefore, how to improve the efficiency and accuracy of the installation of the encoder code disc is a problem to be solved. SUMMARY

[0004] (I) Technical solution

[0005] The embodiment of the application provides an encoder code disc baseline detection system, comprising: a high-speed image sensor module, configured to acquire an original image of an encoder code disc baseline and output the original image pixel by pixel; a morphological filtering module, configured to receive the original image, pre-process the original image to obtain a pre-processed image, and output the pre-processed image pixel by pixel, wherein the pre-processing comprises, in sequence, an erosion and dilation operation, an image subtraction operation, a dilation and erosion operation and a Gaussian filtering operation; a baseline segmentation module, configured to perform baseline feature screening on the pre-processed image to obtain a baseline feature image, and output the baseline feature image pixel by pixel; the baseline feature screening comprises, in sequence, a gradient calculation logic operation, a maximum value suppression segmentation logic operation and a baseline feature screening operation; a baseline feature extraction module, configured to perform connected domain feature screening on the baseline feature image to obtain a baseline feature, wherein the connected domain feature screening comprises, in sequence, a connected domain marking operation and a connected domain feature extraction operation; and a cache module, configured to, before performing a current operation, acquire image pixels to be operated and cache the image pixels to be operated as an image block to be processed, and when the number of pixels of the image block to be processed meets a number requirement of the current operation on pixels, perform the current operation, wherein the current operation comprises the erosion and dilation operation, the image subtraction operation, the dilation and erosion operation, the Gaussian filtering operation, the gradient calculation logic operation, the maximum value suppression segmentation logic operation, the baseline feature screening operation, the connected domain marking operation and the connected domain feature extraction operation, and the image pixels to be operated comprise image pixels output by a previous operation or a previous module.

[0006] Optionally, the encoder code disc baseline detection system further comprises: an output interface module, configured to output the baseline feature and system state data; and a core control module, configured to acquire module working states of the high-speed image sensor module, the morphological filtering module, the baseline segmentation module and the baseline feature extraction module, output a control selection signal to the high-speed image sensor module, output image processing parameters to the morphological filtering module and the baseline segmentation module, and receive system state data calculated by the baseline segmentation module.

[0007] Optionally, the high-speed image sensor module comprises: a high-speed image sensor, configured to acquire real-time image data of the encoder code disc baseline and convert the real-time image data into a data stream for output; an emulator interface analysis logic, configured to acquire analog image data of the code disc baseline and output the analog image data; and an input selection logic, configured to select a first input source of the original image according to a control selection signal output by the core control module, wherein the first input source comprises the high-speed image sensor or the emulator interface analysis logic.

[0008] Optionally, the morphological filtering module comprises: dilation erosion logic for performing a dilation erosion operation, including performing a dilation erosion morphological operation on the original image to obtain a dilation erosion image; image subtraction logic for performing an image subtraction operation, including subtracting the dilation erosion image from the original image to obtain a subtraction image; erosion dilation logic for performing an erosion dilation operation, including performing an erosion dilation morphological operation on the subtraction image to obtain an erosion dilation image; and Gaussian filtering logic for performing a Gaussian filtering operation, including performing a convolution on the erosion dilation image using a 3x3 Gaussian filter kernel to obtain a preprocessed image. The dilation erosion logic and the erosion dilation logic determine the filtering radius of the dilation erosion operation and the erosion dilation operation based on the image processing parameters output by the core control module.

[0009] Optionally, the baseline segmentation module comprises: gradient calculation logic for performing a gradient calculation logic operation, including calculating the image gradient of the preprocessed image to obtain a gradient image and an image gradient feature, the image gradient feature including a gradient amplitude and a direction value; maximum value suppression segmentation logic for performing a maximum value suppression segmentation logic operation, including performing non-maximum value suppression segmentation on the gradient image to obtain an edge image; and baseline feature screening logic for performing a baseline feature screening operation, including performing baseline feature screening on the edge image according to the direction value and obtaining a baseline feature image.

[0010] Optionally, the gradient calculation logic further comprises calculating an average gradient value of the preprocessed image according to the gradient amplitude and outputting the average gradient value to the core control module; and the maximum value suppression segmentation logic further comprises determining a segmentation threshold value of the non-maximum value suppression segmentation operation according to the image processing parameters output by the core control module.

[0011] Optionally, the baseline feature extraction module comprises: connected domain labeling logic for performing a connected domain labeling operation, including performing neighborhood padding on the baseline feature image block, determining the connected relationship, and outputting a connected domain labeled image; and connected domain feature extraction logic for performing a connected domain feature extraction operation, including extracting and screening the connected domain features of the connected domain labeled image, and obtaining a baseline feature based on the connected domain features that satisfy a baseline feature range, the baseline feature including a center coordinate, a rotation angle, and a connected domain pixel number.

[0012] Optionally, the system state data includes a transverse average gradient value of the preprocessed image obtained through the gradient calculation logic; and the output interface module comprises: data integration and sending logic for merging the system state data and the baseline feature to obtain system data; and high-speed data interface logic for outputting the system data.

[0013] Embodiments of the present application provide an encoder code disc baseline detection method, comprising:

[0014] An original image of an encoder code disc baseline is acquired, and the original image is output pixel by pixel; the original image is preprocessed to obtain a preprocessed image, which includes, in sequence, an expansion and erosion operation, an image subtraction operation, an erosion and expansion operation, and a Gaussian filtering operation, and the preprocessed image is output pixel by pixel; the preprocessed image is subjected to baseline feature screening to obtain a baseline feature image, which includes, in sequence, a gradient calculation logic operation, a maximum value suppression segmentation logic operation, and a baseline feature screening operation, and the baseline feature image is output pixel by pixel; the baseline feature image is subjected to connected domain feature screening, which includes, in sequence, a connected domain marking operation and a connected domain feature extraction operation, and a baseline feature is obtained; before a current operation is performed, an image pixel to be operated is acquired and the image pixel to be operated is buffered as an image block to be processed, and when the number of pixels of the image block to be processed meets the number requirement of the current operation for pixels, the current operation is performed, and the current operation includes the expansion and erosion operation, the image subtraction operation, the erosion and expansion operation, the Gaussian filtering operation, the gradient calculation logic operation, the maximum value suppression segmentation logic operation, the baseline feature screening operation, the connected domain marking operation, and the connected domain feature extraction operation, and the image pixel to be operated includes an original image pixel or an image pixel output by a previous operation.

[0015] Optionally, preprocessing the original image includes: performing an expansion and erosion morphological operation on the original image; subtracting the original image from the image after the expansion and erosion; performing an erosion and expansion morphological operation on the image after the subtraction; performing a Gaussian filtering on the image after the erosion and expansion; and the baseline feature screening on the preprocessed image includes: performing a convolution operation on the preprocessed image to obtain a gradient image; performing a non-maximum value suppression segmentation on the gradient image to obtain an edge image; performing the baseline feature screening on the edge image; and the connected domain feature screening on the baseline feature image includes: performing a connected domain filling and marking on the baseline feature image to obtain a connected domain marking image; and extracting connected domain features of the connected domain marking image and screening the connected domain features that meet the baseline features to obtain the baseline features.

[0016] (B) Beneficial effects

[0017] The application designs an encoder code disc baseline detection system, which completes the collection, processing and transmission of the encoder code disc baseline image through the high-speed image sensor, the image processing modules and the input and output control module in the system, reduces the baseline position acquisition delay of the entire encoder code disc installation system, and improves the installation efficiency and installation accuracy.

[0018] The buffer module in the system enables the image processing modules to process the image data stream output by the image sensor in a pulsating flow manner, the image processing is completed at the same time as the image output by the image sensor, the image buffer occupation is reduced, the real-time performance of the image processing is improved, the complexity of the system is reduced, and the system integration and operation efficiency are improved. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 An encoder code disc baseline detection system working structure schematic diagram provided by an embodiment of the present application is schematically shown.

[0020] Figure 2 A structure schematic diagram of a high-speed image sensor module provided by an embodiment of the present application is schematically shown.

[0021] Figure 3 A structure schematic diagram of a morphological filtering module provided by an embodiment of the present application is schematically shown.

[0022] Figure 4 A structure schematic diagram of a baseline segmentation module provided by an embodiment of the present application is schematically shown.

[0023] Figure 5 A structure schematic diagram of a baseline feature extraction module provided by an embodiment of the present application is schematically shown.

[0024] Figure 6 A structure schematic diagram of an output interface module provided by an embodiment of the present application is schematically shown.

[0025] Figure 7 A flow chart of a motor encoder code disc baseline detection method provided by an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0026] To make the objects, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and specific embodiments.

[0027] The description of the structural embodiments and methods of the present application is disclosed herein. It should be understood that the present application is not intended to be limited to the specific disclosed embodiments, and the present application can be implemented by using other features, elements, methods and embodiments. Similar elements in different embodiments are generally marked with similar numbers.

[0028] Figure 1 An encoder code disc baseline detection system working structure schematic diagram provided by an embodiment of the present application is schematically shown.

[0029] As Figure 1 shown, the encoder code disc baseline detection system working structure includes an encoder code disc baseline detection system, which is used to collect images of motor encoder code disc baseline, and output baseline features of the baseline images and system state data of the motor encoder code disc to a code disc installation and calibration control part. The code disc installation and calibration control part is used to calibrate and install the motor encoder code disc according to the baseline features and the system state data.

[0030] AsFigure 1 As shown, the encoder code disc baseline detection system comprises a high-speed image sensor module 100, a morphological filtering module 200, a baseline segmentation module 300, a baseline feature extraction module 300, an output interface module 500, and a core control module 600.

[0031] In the embodiments provided by the present application, the high-speed image sensor module (100) is used to acquire the original image of the encoder code disc baseline and output the original image pixel by pixel; the morphological filtering module (200) is used to receive the original image pixel output by the high-speed image sensor module (100), then pre-process the original image pixel to obtain a pre-processed image, and output the pre-processed image pixel by pixel; the baseline segmentation module (300) is used to receive the pre-processed image pixel output by the morphological filtering module (200), and perform baseline feature screening on the pre-processed image to obtain a baseline feature image, and output the baseline feature image pixel by pixel; and the baseline feature extraction module (400) is used to receive the baseline feature image pixel output by the baseline segmentation module (300) and perform connected domain feature screening on the baseline feature image to obtain a baseline feature.

[0032] In the embodiments provided by the present application, the encoder code disc baseline detection system comprises a cache module, which is used to acquire the image pixel to be operated before performing a current operation, and cache the image pixel to be operated as a to-be-processed image block, and perform the current operation when the number of pixels of the to-be-processed image block meets the number requirement of the current operation on the pixels, wherein the current operation comprises an expansion corrosion operation, an image subtraction operation, a corrosion expansion operation, a Gaussian filtering operation, a gradient calculation logic operation, a maximum value suppression segmentation logic operation, a baseline feature screening operation, a connected domain marking operation, and a connected domain feature extraction operation, and the image pixel to be operated comprises the image pixel output by the previous operation or the previous module.

[0033] In the embodiments provided by the present application, when the current operation is the expansion corrosion operation, the image pixel to be operated is from the original image pixel output by the high-speed image sensor module 100, and when the current operation is other operation than the expansion corrosion operation, the image pixel to be operated is from the image pixel output by the previous operation of the current operation, for example, when the image subtraction operation is performed, the image pixel to be operated is the image pixel output after the original image is subjected to the expansion corrosion operation.

[0034] In the embodiment provided by the application, the buffer module enables each module and operation to process image data in a pulsating pipeline manner, that is, while the previous module or operation outputs image pixels, the output image pixels are buffered, and when the current operation meets the requirement of the number of pixels, the current operation can be started to process the image pixels. Thus, the current operation can process the image pixels while the previous operation or module outputs the pixels, without waiting for the previous operation or module to output all the image pixels before obtaining the image pixels to process the image pixels. Further, the buffer module can reduce the occupation of image buffer, improve the real-time performance of image processing, reduce the complexity of the system, and facilitate the efficiency of system integration and operation.

[0035] Figure 2 A structure schematic diagram of the high-speed image sensor module provided by the embodiment of the application is schematically shown.

[0036] As shown in Figure 2 The high-speed image sensor module 100 includes a high-speed image sensor 101, an analog interface analysis logic 102, and an input selection logic 103. The high-speed image sensor 101 captures the baseline on the motor encoder disc in rotation by the high-speed image sensor, and converts the captured baseline image into an image data stream and transmits the image data stream to the input selection logic 103. The analog interface analysis logic 102 obtains analog baseline image data, which includes baseline image data generated by computer software simulation or baseline image data actually captured and saved. The analog baseline image data is transmitted to the input selection logic 103. The input selection logic 103 is configured to select a first input source of the original image of the encoder disc baseline detection system according to the input control signal output by the core module 600. The first input source of the original image is one of the baseline image transmitted by the high-speed image sensor 101 and the analog baseline image transmitted by the analog interface analysis logic 102. When the original image is the analog baseline image, it represents that the correctness of the functions of each module in the encoder disc baseline detection system is detected by the analog baseline image, thereby ensuring that the encoder disc baseline detection system can accurately and correctly operate.

[0037] In the embodiment provided by the application, the resolution of the image captured by the high-speed image sensor 101 is 1920x1080, and the frame rate is 100fps. For the encoder disc in rotation, the high-speed image sensor 101 adopts a global exposure mode to capture images, which can effectively reduce the discontinuity of images captured in a rolling exposure mode. In the process of transmitting image data, the interface can output pixel data by using a high-speed serial interface, and the analog interface analysis logic 102 can use a gigabit Ethernet interface as the interface of the simulator.

[0038] Figure 3 A structural schematic diagram of a morphological filtering module provided by an embodiment of the present application is shown schematically.

[0039] As shown in the figure, the morphological filtering module includes dilation erosion logic 201, image subtraction logic 202, erosion dilation logic 203, and Gaussian filtering logic 204. Figure 3 The dilation erosion logic 201 is configured to perform a dilation erosion operation, including performing a dilation erosion morphological operation on the original image to obtain a dilation erosion image.

[0040] In the embodiment provided by the present application, the operation core of the dilation erosion operation is a circle, and the diameter is set to 2 times the pixel number corresponding to the baseline width. The original image is processed pixel by pixel according to the input mode of the original image data stream. First, a dilation operation is performed, and an image block with the same size as the operation core is cached. The maximum value of the image pixels in the image block is found and used as the output of the current pixel. The erosion operation is similar to the dilation operation, that is, the minimum value of the image pixels in the image block is found and used as the output of the current pixel.

[0041] In the embodiment provided by the present application, the image subtraction logic 202 is configured to subtract the original image from the image after the dilation erosion operation, and set the pixels less than 0 in the obtained result image to 0.

[0042] In the embodiment provided by the present application, the erosion dilation logic 203 is configured to perform an erosion dilation operation, including performing an erosion dilation morphological operation on the subtracted image to obtain an erosion dilation image.

[0043] In the embodiment provided by the present application, the operation core of the erosion dilation operation is a circle, and the diameter is set to 1 / 2 of the pixel number corresponding to the baseline width. The implementation steps are similar to the dilation erosion steps, but the image is first eroded and then dilated.

[0044] In the embodiment provided by the present application, the dilation erosion logic 201 and the erosion dilation logic 203 generate operation cores with different radii according to the filter radius output by the core control module 600. By performing the dilation erosion operation, the image subtraction operation, and the erosion dilation operation on the original image, the interference of the remaining features can be reduced while the baseline features of the original image are retained.

[0045] In the embodiment provided by the present application, the Gaussian filtering logic 204 is configured to perform a Gaussian filtering operation, including performing convolution on the erosion dilation image using a 3x3 Gaussian filtering core to obtain a preprocessed image. The Gaussian filtering uses a 3x3 Gaussian filtering core to perform a weighted average operation on the image. The standard deviation of the Gaussian filtering core is set to 1.5 times the baseline width.

[0046] In the embodiment provided by the application, the baseline of the motor encoder code disc has a width of 11-12 pixels in the collected image, the filter template in the erosion and expansion logic 201 is set as a circular template with a diameter of 25 pixels, so that the baseline can be removed after the erosion and expansion operation, the filter template in the erosion and expansion logic 203 is set as a circular template with a diameter of 9 pixels, so that the baseline can be reserved in the image after the erosion and expansion operation; the Gaussian filter logic 204 uses a 3*3 Gaussian filter kernel function to convolve with the image, so that the Gaussian noise introduced by the image sensor can be reduced.

[0047] Figure 4 The structure schematic diagram of the baseline segmentation module provided by the embodiment of the application is schematically shown.

[0048] As shown in Figure 4 , the baseline segmentation module 300 includes gradient calculation logic 301, non-maximum suppression segmentation logic 302 and baseline feature screening logic 303.

[0049] In the embodiment provided by the application, the gradient calculation logic 301 is used to perform gradient calculation logic operation, including calculating the image gradient of the preprocessed image to obtain a gradient image and image gradient features, the image gradient features including gradient amplitude and direction value. Meanwhile, the average gradient of the image is calculated according to the gradient amplitude, and the average gradient is output to the core control module 600.

[0050] In the embodiment provided by the application, the process of the gradient calculation logic 301 performing gradient calculation logic operation includes: using a Sobel operator to convolve with the preprocessed image after morphological filtering to obtain the x-direction gradient G x and y-direction gradient G y of the image, using to calculate the amplitude of the gradient, to calculate the direction of the gradient, and obtaining a gradient image.

[0051] In the embodiment provided by the application, the baseline of the motor encoder code disc is a vertical line in the image, and there is surface dirt. The gradient value of the surface dirt is generally less than 50, and the gradient calculation logic 301 takes the gradient value 50 as a measurement index of image definition, calculates the horizontal average gradient of the gradient greater than 50, and regards the horizontal average gradient less than 50 as surface dirt.

[0052] In the embodiment provided by the application, the non-maximum suppression segmentation logic 302 is used to perform maximum value suppression segmentation logic operation, including performing non-maximum suppression segmentation on the gradient image to obtain an edge image.

[0053] In the embodiment provided by the present application, the non-maxima suppression segmentation operation of the non-maxima suppression segmentation logic 302 specifically includes dividing the gradient direction into 8 directions, searching for a maximum value in a 3*3 neighborhood according to the gradient direction, setting the output value of the current position pixel to 1 if the position of the maximum value is the same as the gradient direction and is greater than the segmentation threshold, and outputting the gradient amplitude and direction of the corresponding pixel, otherwise outputting 0.

[0054] In the embodiment provided by the present application, the segmentation threshold of the non-maxima suppression segmentation operation performed by the non-maxima suppression segmentation logic 302 is determined according to the image processing parameter output by the core control module 600, the non-maxima suppression segmentation logic 302 performs segmentation by using a double threshold according to the direction information and gradient value of the gradient image, the segmentation threshold is dynamically adjusted by the core control module 600 according to the brightness of the image, and the non-maxima suppression segmentation logic 302 extracts the edge features in the gradient image and outputs strong edges exceeding the high threshold and weak edges higher than the low threshold.

[0055] In the embodiment provided by the present application, the baseline feature screening logic 303 is used to perform a baseline feature screening operation, which includes screening the edge image according to the direction value and obtaining a baseline feature image.

[0056] In the embodiment provided by the present application, the baseline feature screening operation performed by the baseline feature screening logic 303 specifically includes screening the edge image output by the non-maxima suppression segmentation logic 302 according to the gradient image output by the gradient calculation logic 301, performing gradient direction judgment on the edge image pixel by pixel, setting the edge image not meeting the baseline feature to 0, retaining the strong and weak edge images meeting the baseline gradient feature, and finally outputting the baseline feature image.

[0057] Figure 5 The structure schematic diagram of the baseline feature extraction module provided by the embodiment of the present application is schematically shown.

[0058] As shown in Figure 5 The baseline feature extraction module 400 includes the connected domain marking logic 401 and the connected domain feature extraction logic 402.

[0059] In the embodiment provided by the present application, the connected domain marking logic 401 is used to perform a connected domain marking operation, which includes performing neighborhood filling on the baseline feature image, judging the connected relationship, and outputting a connected domain marking image.

[0060] In the embodiment provided by the application, the specific process in which the connected domain marking logic 401 performs the connected domain marking operation includes performing neighborhood filling on the baseline feature image to avoid discontinuity of the baseline edge feature caused by segmentation screening, and the neighborhood filling is performed in a 3*3 neighborhood filling manner, that is, 3*3 image pixels are cached, and if there is a non-0 pixel around the center pixel, the output center pixel is set to 1. The filled image is marked with a connected domain, the last row of the connected domain marking is cached to set the connected domain marking number of the current position, and a connection relationship table of the connected domain is generated to record the connected domains that are connected to each other, and finally a connected domain marking image is output.

[0061] In the embodiment provided by the application, the connected domain feature extraction logic 402 is used to perform the connected domain feature extraction operation, and the specific operation includes extracting and screening the connected domain features of the connected domain marking image, and obtaining the baseline feature based on the connected domain features that meet the baseline feature range. The connected domain features include a center coordinate, a rotation angle and a connected domain pixel number.

[0062] The specific process in which the connected domain feature extraction logic 402 performs the connected domain feature extraction operation includes that the connected domain feature extraction logic 402 has a connected domain feature cache inside, and the connected domain features are counted based on the connected domain marking connection relationship table and the connected domain image marked by the connected domain marking logic 401. The counted connected domain features include the label boundary of the connected domain, the pixel numbers of the strong edge and the weak edge of the connected domain, the gradient accumulation sum and the gradient direction accumulation sum of the connected domain, the connected domain whose strong edge and weak edge are both weak edges is removed according to the pixel numbers of the strong edge and the weak edge of the connected domain, and the center coordinate and the rotation angle features of the connected domain are calculated according to the gradient direction accumulation sum of the connected domain and the label boundary of the connected domain, so that the baseline feature of the motor code disc is obtained.

[0063] Figure 6 The structure schematic diagram of the output interface module provided by the embodiment of the application is schematically shown.

[0064] As shown in Figure 6 The output interface module 500 includes a data integration and sending logic 501 and a high-speed data interface logic 502.

[0065] In the embodiment provided by the application, the data integration and sending logic 501 is used to combine the system state data and the baseline feature to obtain system data. The system state data is the transverse average gradient value of the preprocessed image obtained by the gradient calculation logic 301, and the system state data is transmitted from the core module 600 to the data integration and sending logic 501.

[0066] In the embodiment provided by the application, the high-speed data interface module 502 is used to output the system data, and the code disc installation and calibration control system can realize the alignment, focusing and radial eccentricity calibration adjustment of the motor encoder code disc according to the system state data.

[0067] Figure 7 A flow chart of a motor encoder disc baseline detection method provided by an embodiment of the application is schematically shown, including sub-operations S710-S740.

[0068] In sub-operation S710, an original image of an encoder disc baseline is acquired, and the original image is output pixel by pixel.

[0069] In sub-operation S720, the original image is preprocessed to obtain a preprocessed image, including, in sequence, an expansion and erosion operation, an image subtraction operation, an erosion and expansion operation, and a Gaussian filtering operation, and the preprocessed image is output pixel by pixel.

[0070] In an embodiment provided by the application, preprocessing of the original image includes:

[0071] The original image is subjected to an expansion and erosion morphological operation, the image after the expansion and erosion is subtracted from the original image, the image after the subtraction is subjected to an erosion and expansion morphological operation, and the image after the erosion and expansion is subjected to a Gaussian filtering operation.

[0072] In sub-operation S730, baseline feature screening is performed on the preprocessed image to obtain a baseline feature image, including, in sequence, a gradient calculation logic operation, a maximum value suppression segmentation logic operation, and a baseline feature screening operation, and the baseline feature image is output pixel by pixel.

[0073] In an embodiment provided by the application, baseline feature screening of the preprocessed image includes: performing a convolution operation on the preprocessed image to obtain a gradient image; performing non-maximum value suppression segmentation on the gradient image to obtain an edge image; and performing baseline feature screening on the edge image.

[0074] In sub-operation S740, connected domain feature screening is performed on the baseline feature image, including, in sequence, a connected domain marking operation and a connected domain feature extraction operation, and a baseline feature is obtained.

[0075] In an embodiment provided by the application, connected domain feature screening of the baseline feature image includes: performing connected domain filling and marking on the baseline feature image to obtain a connected domain marking image; and extracting connected domain features of the connected domain marking image and screening connected domain features that satisfy the baseline feature, to obtain the baseline feature.

[0076] In the embodiments provided by the present application, before performing a current operation, an image pixel to be operated is acquired and the image pixel to be operated is cached as a to-be-processed image block, when the number of pixels of the to-be-processed image block meets the number requirement of the current operation on the pixels, the current operation is performed, the current operation includes an expansion erosion operation, an image subtraction operation, an erosion expansion operation, a Gaussian filtering operation, a gradient calculation logic operation, a maximum value suppression segmentation logic operation, a baseline feature screening operation, a connected domain marking operation and a connected domain feature extraction operation, and the image pixel to be operated includes an original image pixel or an image pixel output by a previous operation.

[0077] The above specific embodiments further specifically describe the purposes, technical solutions and beneficial effects of the present application. It should be understood that the above are only specific embodiments of the present application and are not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. An encoder disc base line detection system, characterized by, The application relates to a high-speed image sensor module (100) for acquiring original images of an encoder code disc baseline and outputting the original images pixel by pixel; a morphological filtering module (200) for receiving the original images and pre-processing the original images to obtain pre-processed images and outputting the pre-processed images pixel by pixel, wherein the pre-processing comprises, in sequence, an expansion and corrosion operation, an image subtraction operation, a corrosion and expansion operation and a Gaussian filtering operation; a baseline segmentation module (300) for performing baseline feature screening on the pre-processed images to obtain baseline feature images and outputting the baseline feature images pixel by pixel; the baseline feature screening comprises, in sequence, a gradient calculation logic operation, a maximum value suppression segmentation logic operation and a baseline feature screening operation; a baseline feature extraction module (400) for performing connected domain feature screening on the baseline feature images to obtain baseline features, wherein the connected domain feature screening comprises, in sequence, a connected domain marking operation and a connected domain feature extraction operation; and a buffer module for acquiring image pixels to be operated before performing a current operation and buffering the image pixels to be operated as an image block to be processed, wherein when the number of pixels of the image block to be processed meets the number requirement of the current operation, the current operation is performed, the current operation comprises the expansion and corrosion operation, the image subtraction operation, the corrosion and expansion operation, the Gaussian filtering operation, the gradient calculation logic operation, the maximum value suppression segmentation logic operation, the baseline feature screening operation, the connected domain marking operation and the connected domain feature extraction operation, and the image pixels to be operated comprise image pixels output by a previous operation or a previous module. The application further relates to an output interface module (500) for outputting the baseline features and system state data; a core control module (600) for acquiring module working states of the high-speed image sensor module (100), the morphological filtering module (200), the baseline segmentation module (300) and the baseline feature extraction module (400); outputting a control selection signal to the high-speed image sensor module (100); outputting image processing parameters to the morphological filtering module (200) and the baseline segmentation module (300) and receiving system state data calculated by the baseline segmentation module (300). The high-speed image sensor module (100) comprises a high-speed image sensor (101) for acquiring real-time image data of an encoder code disc baseline and converting the real-time image data into a data stream for output; an emulator interface analysis logic (102) for acquiring analog image data of the code disc baseline and outputting the analog image data; and an input selection logic (103) for selecting a first input source of the original images according to a control selection signal output by the core control module (600), wherein the first input source comprises the high-speed image sensor (101) or the emulator interface analysis logic (102). The morphological filtering module (200) comprises ​ ​ 2. The encoder disc baseline detection system of claim 1, wherein, ​ ​ ​ ​ ​ 3. The encoder disc baseline detection system of claim 1, wherein, ​ ​ ​ ​ 4. The encoder disc baseline detection system of claim 1, wherein, ​ dilation erosion logic (201) configured to perform the dilation erosion operation, including performing a dilation erosion morphological operation on the original image to obtain a dilation erosion image; image subtraction logic (202) configured to perform the image subtraction operation, including subtracting the dilation erosion image from the original image to obtain a subtraction image; erosion dilation logic (203) configured to perform the erosion dilation operation, including performing an erosion dilation morphological operation on the subtraction image to obtain an erosion dilation image; Gaussian filtering logic (204) to perform the Gaussian filtering operation including employing convolving the corrosion dilation image with a Gaussian filter kernel to obtain the pre-processed image; the dilation erosion logic (201) and the erosion dilation logic (203) are configured to determine the filter radius of the dilation erosion operation and the erosion dilation operation based on image processing parameters output by a core control module (600).

5. The encoder disc baseline detection system of claim 1, wherein, The baseline segmentation module (300) comprises: gradient calculation logic (301) configured to perform the gradient calculation operation, including calculating the image gradient of the preprocessed image to obtain a gradient image and an image gradient feature, the image gradient feature including a gradient amplitude and a direction value; non-maximum suppression segmentation logic (302) configured to perform the non-maximum suppression segmentation operation, including performing non-maximum suppression segmentation on the gradient image to obtain an edge image; baseline feature screening logic (303) configured to perform the baseline feature screening operation, including performing baseline feature screening on the edge image according to the direction value and obtaining a baseline feature image.

6. The encoder disc baseline detection system of claim 5, wherein, The gradient calculation logic (301) further comprises: calculating the average gradient value of the preprocessed image according to the gradient amplitude, and outputting to the core control module (600); The non-maximum suppression segmentation logic (302) further comprises: determining the segmentation threshold of the non-maximum suppression segmentation operation according to the image processing parameters output by the core control module (600).

7. The encoder disc baseline detection system of claim 1, wherein, The baseline feature extraction module (400) comprises: connected domain labeling logic (401) configured to perform the connected domain labeling operation, including performing neighborhood filling on the baseline feature image, determining the connected relationship, and outputting a connected domain label image; connected domain feature extraction logic (402) configured to perform the connected domain feature extraction operation, including extracting and screening the connected domain features of the connected domain label image, and obtaining the baseline feature based on the connected domain features that meet the baseline feature range, the baseline feature including: the center coordinates of the connected domain, the number of connected domain pixels, and the rotation angle feature.

8. The encoder code disc baseline detection system according to claim 2, wherein the system state data includes the lateral average gradient value of the preprocessed image obtained by the gradient calculation logic (301); The output interface module (500) comprises: data integration and sending logic (501) configured to merge the system state data and the baseline feature to obtain system data; high-speed data interface logic (502) configured to output the system data.

9. An encoder disc base line detection method, characterized by, comprising: obtaining an original image of an encoder code disc baseline, and outputting the original image pixel by pixel; The original image is preprocessed to obtain a preprocessed image, which comprises, in sequence, an expansion and corrosion operation, an image subtraction operation, a corrosion and expansion operation, and a Gaussian filtering operation, and the preprocessed image is output pixel by pixel; Baseline feature screening is performed on the preprocessed image to obtain a baseline feature image, which comprises, in sequence, a gradient calculation logic operation, a maximum value suppression segmentation logic operation, and a baseline feature screening operation, and the baseline feature image is output pixel by pixel; Connected domain feature screening is performed on the baseline feature image, which comprises, in sequence, a connected domain marking operation and a connected domain feature extraction operation, and a baseline feature is obtained; Before performing a current operation, an image pixel to be operated is obtained and the image pixel to be operated is buffered as a to-be-processed image block, and when the number of pixels of the to-be-processed image block meets the number requirement of the current operation for pixels, the current operation is performed, the current operation comprising the expansion and corrosion operation, the image subtraction operation, the corrosion and expansion operation, the Gaussian filtering operation, the gradient calculation logic operation, the maximum value suppression segmentation logic operation, the baseline feature screening operation, the connected domain marking operation, and the connected domain feature extraction operation, the image pixel to be operated comprising an original image pixel or an image pixel output by a previous operation.

10. The encoder code disc baseline detection method according to claim 9, wherein the preprocessing of the original image comprises: performing an expansion and corrosion morphological operation on the original image, subtracting the original image from the image after the expansion and corrosion, performing a corrosion and expansion morphological operation on the image after the subtraction, and performing a Gaussian filtering operation on the image after the corrosion and expansion; the baseline feature screening of the preprocessed image comprises: performing a convolution operation on the preprocessed image to obtain a gradient image, performing a non-maximum value suppression segmentation on the gradient image to obtain an edge image, and performing baseline feature screening on the edge image; the connected domain feature screening of the baseline feature image comprises: performing connected domain filling and marking on the baseline feature image to obtain a connected domain marking image, and extracting connected domain features of the connected domain marking image and screening connected domain features meeting the baseline feature to obtain the baseline feature.

Citation Information

Patent Citations

  • Circular grating eccentricity calculation method for encoder eccentricity adjustment system

    CN106951814A

  • High-precision underground pipeline position detection device

    CN216209943U