Method, device and equipment for eliminating specified direction cords based on extreme value filtering
By using extreme value filtering technology and calculating the gray-scale mean and similarity using a sliding window, the starting point and direction of the cord are determined, eliminating cord interference and improving the accuracy and robustness of defect detection in tire X-ray images.
Patent Information
- Application Number
- CN202310286098.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In tire X-ray images, cords interfere with defect detection, especially when the cord angle changes slightly. Existing technologies struggle to effectively eliminate this interference, thus affecting detection results.
An extreme value filtering method is adopted, which calculates the gray-scale mean and similarity through a sliding window to determine the starting end and direction of the curtain. The connection angle is used to eliminate the curtain in the specified direction, and the pixel value of the curtain is replaced by interpolation.
It effectively eliminates cord interference, improves the accuracy and robustness of defect detection in tire X-ray images, and can effectively handle cords with slight angular changes.
Smart Images

Figure CN116342523B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a method, device and equipment for eliminating specified direction cords based on extreme value filtering, and belongs to the technical field of image processing. BACKGROUND
[0002] In the tire production process, due to factors such as production equipment and process flow, a small number of products with impurities and other quality defects often occur, which reduces the product quality, not only wastes resources, but also affects the service life of the tire and brings safety hazards to the people on the vehicle. Therefore, it is very important to detect tire defects, find problems in time and improve the quality of the tires leaving the factory.
[0003] Product surface anomaly detection in an industrial scene is crucial to the development of industrial intelligence. Currently, computer vision technology has been introduced into many industrial products for quality detection. Compared with manual detection, it has the advantages of high efficiency and prevention of secondary damage. To meet the needs of enterprises, X-ray imaging systems can be used to detect defects in tires in real time.
[0004] In a tire X-ray image, the cords in the sidewall area can be clearly seen. However, when there are some defects such as impurities in the sidewall area, the cords will cause unnecessary interference in the detection of the defects. SUMMARY
[0005] To solve the above problems, the application provides a method, device and equipment for eliminating specified direction cords based on extreme value filtering, which can solve the detection interference caused by the cords and has an elimination effect on cords with slight changes in angle.
[0006] The technical scheme adopted by the application to solve the technical problems is:
[0007] On the one hand, the application provides a method for eliminating specified direction cords based on extreme value filtering, which includes the following steps:
[0008] Obtain a tire X-ray image, and start from the first column on the left end of the image, slide the window from top to bottom and calculate the gray mean value of the window;
[0009] Calculate the minimum value of the gray mean value of all windows, determine the starting end of the cord, and save the pixel and coordinates of the starting end of the cord;
[0010] From the starting end of each cord, slide the window along the specified direction, calculate the gray similarity between the sliding window and the cord starting end window, and determine whether the window still belongs to the cord, and save the coordinates of each pixel in the window belonging to the cord;
[0011] When the window similarity is less than or equal to the threshold value S or the number of windows is greater than 8, the connection angle of the window and the cord starting end window is calculated;
[0012] According to the connection angle of the sliding window and the cord starting end window, the cord in the specified direction is found and eliminated.
[0013] As a possible implementation manner of the embodiment, the sliding window is started from the leftmost end of the image and the gray mean value of the window is calculated, including:
[0014] Firstly, all windows of the leftmost first column are taken as the region of interest; wherein the width of the column is N pixels, the window size is N*N pixels, and the sliding step of the window is 1 pixel;
[0015] Secondly, the gray mean value winMean of all sliding windows is calculated and stored in an array.
[0016] As a possible implementation manner of the embodiment, the minimum value of the gray mean value of all windows is calculated, the starting end of the cord is determined, and the pixel and coordinate of the cord starting end are saved, including:
[0017] The minimum value localMin[i] of all gray mean values in the array is calculated, and the total number of minimum values is n, 0≤i<n;
[0018] The mean value of all minimum values is calculated and recorded as localMinMean;
[0019] All window gray mean value minimum values are traversed, and when less than the threshold value localMinMean, the window is the starting end of the cord;
[0020] The pixel and coordinate of all found cord starting ends are saved in an array respectively.
[0021] As a possible implementation manner of the embodiment, the window is slid along the specified direction from the starting end of each cord, the gray similarity of the sliding window and the cord starting end window is calculated, and whether the window still belongs to the cord is judged, and the coordinates of each pixel in the window belonging to the cord are saved, including:
[0022] For the starting end of each cord, a window is opened along the specified direction, and the gray similarity sim of the window and the cord starting end window is calculated using the correlation coefficient formula:
[0023]
[0024] Wherein A[i] represents the i-th pixel in the sliding window A, B[i] represents the i-th pixel in the sliding window B, n represents the number of pixels in the window A and B, And an average value of all pixel values of the corresponding sliding window;
[0025] Sliding the window up and down by one pixel, the gray similarity of the window and the starting end window of the cord is calculated again, and the window with the maximum similarity is recorded. When the similarity sim is greater than a threshold S, it is determined that the window belongs to the cord region, and the coordinates of the window are stored in the coordinate array of the cord.
[0026] As a possible implementation manner of the embodiment, the calculating the connection angle of the window and the starting end window of the cord comprises:
[0027] Taking the first point of the starting end window and the last point of the current window, the angle of the line connecting the two point coordinates is the connection angle angle.
[0028] As a possible implementation manner of the embodiment, the finding the cord in the specified direction according to the connection angle of the sliding window and the starting end window of the cord and eliminating the cord comprises:
[0029] If the connection angle angle does not exceed the specified direction Angle range, the cord is continuously tracked until the end of the cord is found.
[0030] The normal angle of the accurate angle of the found cord is calculated.
[0031] Each window belonging to the cord is re-iterated, and the pixel value of the normal angle is used for interpolation to replace the pixel value in the window, so as to realize the elimination of the cord.
[0032] As a possible implementation manner of the embodiment, the process of finding the cord in the specified direction is specifically: when the gray similarity of the window and the starting end window of the cord does not satisfy the threshold condition, and is the same as the specified angle, it is indicated that a relatively complete cord has been found.
[0033] On the other hand, the embodiment of the application provides a device for eliminating a cord in a specified direction based on extreme value filtering, which comprises:
[0034] A window gray mean value calculation module is configured to acquire a tire X-ray image, slide a window from top to bottom from the first column on the left end of the image, and calculate the gray mean value of the window.
[0035] A cord starting end determination module is configured to calculate the minimum value of the gray mean value of all windows, determine the starting end of the cord, and save the pixel and coordinates of the starting end of the cord.
[0036] A window gray similarity calculation module is configured to slide a window from the starting end of each cord in a specified direction, calculate the gray similarity of the sliding window and the starting end window of the cord, judge whether the window still belongs to the cord, and save the coordinates of each pixel in the window belonging to the cord.
[0037] a connection angle calculation module, configured to calculate a connection angle between the window and the cord starting end window when the window similarity is less than or equal to a threshold value S or the number of windows is greater than 8;
[0038] a specified direction cord finding module, configured to find the cord in the specified direction according to the connection angle between the window and the cord starting end window and eliminate the cord.
[0039] In a third aspect, a computer device is provided, which comprises a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, and the processor executes the machine readable instructions to perform the steps of any of the above methods for eliminating the cord in the specified direction based on the extreme value filtering.
[0040] In a fourth aspect, a storage medium is provided, which stores a computer program, and when the computer program is run by a processor, the steps of any of the above methods for eliminating the cord in the specified direction based on the extreme value filtering are performed.
[0041] The technical scheme of the embodiments of the present application can have the following beneficial effects:
[0042] The method for eliminating the cord in the specified direction based on the extreme value filtering is simple and easy to implement, effectively detects the cord in the specified direction and eliminates the cord, plays an auxiliary role in the tire X-ray image anomaly detection, and has good robustness when the angle of the cord has slight changes.
[0043] The device for eliminating the cord in the specified direction based on the extreme value filtering has the same beneficial effects as the method for eliminating the cord in the specified direction based on the extreme value filtering. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 is a flowchart of a method for eliminating the cord in the specified direction based on the extreme value filtering according to an exemplary embodiment;
[0045] Figure 2 is a schematic diagram of a device for eliminating the cord in the specified direction based on the extreme value filtering according to an exemplary embodiment;
[0046] Figure 3 is a flowchart of a method for eliminating the cord in the specified direction by using the device according to an exemplary embodiment;
[0047] Figure 4is a sliding window diagram according to an exemplary embodiment;
[0048] Figure 5 is a cord starting end searching diagram according to an exemplary embodiment;
[0049] Figure 6 is a cord elimination diagram according to an exemplary embodiment;
[0050] Fig. 7(a) and Fig. 7(b) are diagrams showing the effect before and after cord elimination in a tire X-ray image according to an exemplary embodiment. DETAILED DESCRIPTION
[0051] The application will be further described below in conjunction with the accompanying drawings and embodiments:
[0052] To clearly illustrate the technical features of the present application, the following detailed description will be given with specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. In addition, the present application can repeatedly refer to numbers and / or letters in different examples. Such repetition is for the purpose of simplification and clarity, and does not in itself indicate the relationship between the various embodiments and / or settings being discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. The present application omits the description of well-known components and processing techniques and processes to avoid unnecessary limitation of the present application.
[0053] As shown in the drawings, the present application provides a method for eliminating cords in a specified direction based on extreme value filtering, which comprises the following steps: Figure 1
[0054] Obtaining a tire X-ray image, starting from the first column on the left end of the image, sliding the window from top to bottom and calculating the gray mean value of the window;
[0055] Calculating the minimum value of the gray mean value of all windows, determining the starting end of the cord and saving the pixel and coordinate of the starting end of the cord;
[0056] From the starting end of each cord, sliding the window along the specified direction, calculating the gray similarity between the sliding window and the cord starting end window, and at the same time judging whether the window still belongs to the cord, saving the coordinates of each pixel in the window belonging to the cord;
[0057] When the window similarity is less than or equal to the threshold S or the number of windows is greater than 8, the connection angle between the window and the cord starting end window is calculated;
[0058] According to the connection angle between the sliding window and the cord starting end window, the cord in the specified direction is found and eliminated.
[0059] As a possible implementation manner of the embodiment, the sliding window from top to bottom and calculating the gray mean value of the window starting from the left end of the image comprises:
[0060] Firstly, all windows of the first column at the left end are taken as the region of interest; wherein the width of the column is N pixels, the window size is N*N pixels, and the sliding step of the window is 1 pixel; in the embodiment, N is selected as 5 according to the cord width;
[0061] Secondly, the gray mean value winMean of all sliding windows is calculated and stored in an array.
[0062] As a possible implementation manner of the embodiment, the calculating the minimum value of the gray mean value of all windows, determining the starting end of the cord and saving the pixels and coordinates of the starting end of the cord comprises:
[0063] The minimum value localMin[i] of all gray mean values in the array is calculated, and the total number of minimum values is n, 0≤i<n;
[0064] The mean value of all minimum values is calculated and recorded as localMinMean;
[0065] All window gray mean value minimum values are traversed, and when it is less than the threshold localMinMean, the window is the starting end of the cord;
[0066] The pixels and coordinates of all found starting ends of the cord are saved in the array respectively.
[0067] As a possible implementation manner of the embodiment, the sliding window from the starting end of each cord in the specified direction, calculating the gray similarity between the sliding window and the window at the starting end of the cord, and judging whether the window still belongs to the cord, saving the coordinates of each pixel in the window belonging to the cord, comprises:
[0068] For the starting end of each cord, a window is opened in the specified direction, and the gray similarity sim between the window and the window at the starting end of the cord is calculated using the correlation coefficient formula:
[0069]
[0070] Wherein A[i] represents the i th pixel in the sliding window A, B[i] represents the i th pixel in the sliding window B, n represents the number of pixels in the window A and B, And represents the average value of all pixel values of the corresponding sliding window;
[0071] Sliding the window up and down by one pixel, the gray similarity of the window and the cord starting end window is calculated again, and the window with the maximum similarity is recorded, when the similarity sim is greater than a threshold S, it is determined that the window belongs to the cord region, and the coordinates of the window are stored in the cord coordinate array.
[0072] As a possible implementation manner of the embodiment, the connection angle of the window and the cord starting end window is calculated, including:
[0073] Taking the first point of the starting end window and the last point of the current window, the angle of the line connecting the two point coordinates is the connection angle angle.
[0074] As a possible implementation manner of the embodiment, the cord in the specified direction is found and eliminated according to the connection angle of the sliding window and the cord starting end window, including:
[0075] If the connection angle angle does not exceed the specified direction Angle range, the cord is continuously tracked until the end of the cord is found;
[0076] The normal angle of the accurate angle of the found cord is calculated;
[0077] Each window belonging to the cord is re-iterated, and the pixel value of the normal angle is used for interpolation to replace the pixel value in the window, so as to realize the elimination of the cord.
[0078] As a possible implementation manner of the embodiment, the process of finding the cord in the specified direction is specifically: when the gray similarity of the window and the cord starting end window does not satisfy the threshold condition, and is the same as the specified angle, it is indicated that a relatively complete cord has been found.
[0079] As shown in Figure 2 The embodiment of the application provides a device for eliminating cords in a specified direction based on extreme value filtering, which comprises:
[0080] A window gray mean value calculation module is configured to acquire a tire X-ray image, slide a window from top to bottom from the first column at the left end of the image, and calculate the gray mean value of the window.
[0081] A cord starting end determination module is configured to calculate the minimum value of the gray mean value of all windows, determine the starting end of the cord, and save the pixel and coordinates of the cord starting end.
[0082] A window gray similarity calculation module is configured to slide a window from the starting end of each cord in a specified direction, calculate the gray similarity of the sliding window and the cord starting end window, judge whether the window still belongs to the cord, and save the coordinates of each pixel in the window belonging to the cord.
[0083] A connection angle calculation module is configured to calculate a connection angle between the window and a cord starting end window when the window similarity is less than or equal to a threshold value S or the number of windows is greater than 8.
[0084] A specified direction cord finding module is configured to find a cord in a specified direction and eliminate the cord according to the connection angle between the sliding window and the cord starting end window.
[0085] As shown in Figure 3 After the tire X-ray image is acquired, the process of eliminating the cord in the specified direction by using the device of the application includes the following steps:
[0086] Step 1: Calculate the gray mean value of the sliding window from top to bottom starting from the first column of the image:
[0087] First step: first take all the windows in the first column as the region of interest, wherein the width of the column is 5 pixels, the window size is 5*5 pixels, and the window size should be set to be similar to the cord width. The step length of the sliding window is 1 pixel; the sliding window is as shown in Figure 4 y_step represents the sliding window in the specified direction, y_step-1 represents sliding the window upward by one pixel, and y_step+1 represents sliding the window downward by one pixel.
[0088] Second step, calculate the gray mean value winMean of all sliding windows and store it in the array.
[0089] Step 2: Calculate the minimum value of the gray mean value of all windows in the first column to determine the specific steps of the starting end of the cord as follows:
[0090] First step, calculate the minimum value localMin[i] of all gray mean values in the array, and the total number of minimum values is n (0≤i<n).
[0091] Second step, calculate the mean value of all minimum values, denoted as localMinMean.
[0092] Third step, traverse all the minimum values of the window gray mean value, when it is less than the threshold value localMinMean, it means that the cord is found, and this window is the starting end of the cord, as shown in Figure 5 The leftmost end is the starting end of the cord.
[0093] Step 3: Save the pixels and coordinates of all the found cord starting ends into the array respectively.
[0094] Step 4: For the starting end of each cord, slide the window in the specified direction, calculate the gray similarity with the cord starting end window, and judge whether it still belongs to the cord. Save the coordinates of each pixel in the window belonging to the cord:
[0095] First step, open a window along the specified direction, use the correlation coefficient formula to calculate the gray similarity sim of the window and the cord starting window:
[0096]
[0097] Where A[i] represents the i-th pixel in the sliding window A, B[i] represents the i-th pixel in the sliding window B, n represents the number of pixels in the window A, B, And represent the average value of all pixel values in the corresponding sliding window;
[0098] Second step, slide the window up and down by one pixel, calculate the similarity of the window again, record the window with the maximum similarity, when its corresponding similarity sim is greater than the threshold S, then determine that the window belongs to the cord region, store the coordinates of this window into the cord coordinate array.
[0099] Step 5: When a certain window is accumulated, calculate the connection angle of the current window and the cord starting window, if it is too different from the specified direction, then do not perform the specific steps of elimination as follows:
[0100] First step, when the next window similarity is less than or equal to the threshold S, or when the number of windows is greater than 8, calculate the angle of the current tracking line, the calculation method is to take the first point of the starting window and the last point of the current window, the angle of the line connecting the two points is the connection angle;
[0101] Second step, if angle is too different from the specified direction Angle, do not execute the elimination step; if it is within a certain range of the specified direction Angle, execute the elimination step.
[0102] Step 6: For the cord found in the specified direction, as shown in Figure 6 Replace the original pixel value with the pixel value in the normal direction to achieve elimination: Figure 6 In the figure, the dark area from the top left to the bottom right represents the trajectory of the sliding window, which belongs to the cord region, and the line from the bottom left to the top right represents the normal direction of the current window.
[0103] First step, calculate the normal angle of the accurate angle of the found cord;
[0104] Secondly, re-traverse each window belonging to the cord, and use the pixel value of the normal angle to interpolate the pixel value in the window, so as to realize the elimination of the cord, as shown in Fig. 7; Fig. 7(a) is a screenshot of a part of the tire sidewall area in the tire X-ray image, the black block is artificially marked, and there is a foreign matter below. Fig. 7(b) is the effect after the extreme value filtering when the specified direction is 0°. It can be found that the black block is eliminated, but the foreign matter is not eliminated, so the method plays a good auxiliary role for the detection of the foreign matter defect. At the same time, it can also be observed that the cord of the tire sidewall is not completely horizontal, but a good elimination effect can be achieved, so the robustness of the method is good.
[0105] The computer device provided by the embodiment of the application comprises a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the device is running, the processor and the memory communicate through the bus, and the processor executes the machine readable instructions to perform the steps of any of the methods for eliminating the cord in the specified direction based on the extreme value filtering.
[0106] Specifically, the memory and the processor can be general memory and processor, which are not specifically limited here, and when the processor runs the computer program stored in the memory, the method for eliminating the cord in the specified direction based on the extreme value filtering can be executed.
[0107] Those skilled in the art can understand that the structure of the computer device does not constitute a limitation on the computer device, and can comprise more or fewer components than the illustration, or combine certain components, or split certain components, or different component arrangements.
[0108] In some embodiments, the computer device can further include a touch screen which can be used to display a graphical user interface (e.g., a start interface of an application) and receive user operations for the graphical user interface (e.g., a start operation for the application). The touch screen can include a display panel and a touch panel. The display panel can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. The touch panel can collect contact or non-contact operations of a user thereon or therearound, and generate pre-set operation instructions, for example, operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel. In addition, the touch panel can include two parts of a touch detection device and a touch controller. The touch detection device detects the touch position and posture of the user, and detects signals generated by the touch operation, and transmits the signals to the touch controller. The touch controller receives the touch information from the touch detection device, converts the touch information into information that can be processed by the processor, and sends the information to the processor. The touch controller can also receive and execute commands from the processor. In addition, the touch panel can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type, or any technology developed in the future. Further, the touch panel can cover the display panel. The user can operate on or near the touch panel covering the display panel according to the graphical user interface displayed on the display panel. After the touch panel detects the operation thereon or therearound, the touch panel transmits the operation to the processor to determine the user input. Then, the processor provides corresponding visual output on the display panel in response to the user input. In addition, the touch panel and the display panel can be implemented as two independent components or integrated.
[0109] Corresponding to the above-mentioned application starting method, the embodiment of the present application further provides a storage medium, and the storage medium stores a computer program. When the computer program is run by a processor, the steps of any method for eliminating specified direction cords based on extreme value filtering are executed.
[0110] The application starting device provided by the embodiment of the present application can be specific hardware on a device or software or firmware installed on the device. The device provided by the embodiment of the present application has the same implementation principle and technical effects as the above-mentioned method embodiments. For brevity and conciseness, the part not mentioned in the device embodiment part can be referred to the corresponding content in the above-mentioned method embodiments. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned system, device, and unit can be referred to the corresponding process in the above-mentioned method embodiments, which will not be described here.
[0111] Those skilled in the art will appreciate that embodiments of the application can be supplied as a method, a system, or a computer program product. Accordingly, the application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can be in the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage media, etc.) embodying computer readable program code.
[0112] In the embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. The embodiments described above are merely exemplary, and the division of the modules is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different modules can be indirect couplings or communication connections through some interfaces, and there can be electric, mechanical or other forms.
[0113] The modules illustrated as separate components can or can not be physically separate, and the components illustrated as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.
[0114] In addition, each functional module in the embodiments provided by the present application can be integrated in a processing module, or each module can exist physically independently, or two or more modules can be integrated in one module.
[0115] The present application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the computer or other programmable data processing apparatus produce a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or a plurality of flows and / or blocks Figure 1 The device for implementing the functions specified in one flow or a plurality of flows and / or blocks
[0116] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 of the flow or flows and / or blocks Figure 1 of the block or blocks specified in the flow.
[0117] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 of the flow or flows and / or blocks Figure 1 of the block or blocks specified in the flow.
[0118] Finally, it should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the present application. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalent replaced without departing from the spirit and scope of the present application, and any modification or equivalent replacement should be covered in the protection scope of the claims of the present application.
Claims
1. A method of eliminating cords in a specified direction based on extreme value filtering, characterized by, The method comprises the following steps: Obtaining a tire X-ray image, sliding a window from top to bottom and calculating the gray mean value of the window from the first column on the left end of the image; Calculating the minimum value of the gray mean value of all windows to determine the starting end of the cord and save the pixel and coordinate of the starting end of the cord; Sliding the window from the starting end of each cord in a specified direction, calculating the gray similarity of the sliding window and the starting end window of the cord, and judging whether the window still belongs to the cord, saving the coordinates of each pixel in the window belonging to the cord; When the window similarity is less than or equal to the threshold S or the number of windows is greater than 8, calculating the connection angle of the window and the starting end window of the cord; Finding the cord in the specified direction according to the connection angle of the sliding window and the starting end window of the cord and eliminating it; The calculation of the minimum value of the gray mean value of all windows to determine the starting end of the cord and save the pixel and coordinate of the starting end of the cord comprises: Calculating the minimum value localMin[i] of all gray mean values in the array, and the total number of minimum values is n, 0≤i<n; Calculating the mean value of all minimum values, denoted as localMinMean; Traversing all minimum values of the gray mean value of the window, when it is less than the threshold localMinMean, the window is the starting end of the cord; Saving the found pixel and coordinate of all cord starting ends into the array respectively; The sliding of the window from the starting end of each cord in a specified direction, the calculation of the gray similarity of the sliding window and the starting end window of the cord, and the judgment of whether the window still belongs to the cord, and the saving of the coordinates of each pixel in the window belonging to the cord comprise: For each cord starting end, a window is opened along the specified direction, and the gray scale similarity between the window and the cord starting end window is calculated using the correlation coefficient formula sim ; Sliding the window up and down by one pixel, the gray scale similarity of the window and the window of the cord starting end is calculated again, and the window with the maximum similarity is recorded. When the similarity is greater than a threshold S, it is determined that the window belongs to the cord region, and the coordinates of the window are stored in the coordinate array of the cord. sim When the similarity is greater than a threshold S, it is determined that the window belongs to the cord region, and the coordinates of the window are stored in the coordinate array of the cord. The finding of the cord in the specified direction according to the connection angle of the sliding window and the starting end window of the cord and the elimination thereof comprise: If the connection angle angle does not exceed the specified direction Angle range, continue to track the cord until the end of the cord is found; Calculating the normal angle of the accurate angle of the found cord; Re-traversing each window belonging to the cord, using the pixel value of the normal angle for interpolation to replace the pixel value in the window, and realizing the elimination of the cord.
2. The method of eliminating specified direction cords based on extreme value filtering according to claim 1, wherein, The sliding of the window from the left end of the image from top to bottom and the calculation of the gray mean value of the window comprise: Firstly, taking all windows of the first column on the left end as a region of interest; wherein the width of the column is N pixels, the window size is N*N pixels, and the sliding step of the window is 1 pixel; Secondly, calculating the gray mean value winMean of all sliding windows and storing it in the array.
3. The method of eliminating specified direction cords based on extreme value filtering according to claim 1, wherein, The gray scale similarity The calculation of the connection angle of the window and the starting end window of the cord comprises: The calculation formula is: Where A[ i ] indicates the first [element] in sliding window A i 1 pixel, B[ i ] indicates the first [element] in sliding window B. i 1 pixel, n This indicates the number of pixels in windows A and B. and This represents the average value of all pixels in the corresponding sliding window.
4. The method of eliminating specified direction cords based on extreme value filtering according to claim 1, wherein, Taking the first point of the starting end window and the last point of the current window, and the angle of the line connecting the two points is the connection angle angle to be solved. The process of finding the cord in the specified direction is that when the gray similarity of the window and the starting end window of the cord does not satisfy the threshold condition and is the same as the specified angle, it is indicated that a relatively complete cord has been found.
5. The method of eliminating specified direction cords based on extreme value filtering according to any one of claims 1-4, characterized in that, The device for realizing the elimination of the cord in the specified direction based on the extreme value filtering method according to any one of claims 1-5 comprises:
6. An apparatus for eliminating cords in a specified direction based on extreme value filtering, characterized by A window gray mean value calculation module is configured to acquire the tire X-ray image, and calculate the gray mean value of the window by sliding the window from top to bottom starting from the first column at the left end of the image. A cord starting end determination module is configured to calculate the minimum value of the gray mean values of all the windows, determine the starting end of the cord, and save the pixel and coordinate of the cord starting end. A window gray similarity calculation module is configured to slide the window along the specified direction from the starting end of each cord, calculate the gray similarity of the sliding window and the cord starting end window, and determine whether the window still belongs to the cord. A connection angle calculation module is configured to calculate the connection angle of the window and the cord starting end window when the window similarity is less than or equal to a threshold S or the number of windows is greater than 8. A specified direction cord finding module is configured to find the cord in the specified direction according to the connection angle of the sliding window and the cord starting end window, and eliminate the cord.
7. A computer device, comprising: The computer device comprises a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, the processor and the memory communicate through the bus when the computer device is running, and the processor executes the machine readable instructions to perform the steps of the method for eliminating the cord in the specified direction based on the extreme value filtering according to any one of claims 1-5.
8. A storage medium, characterized by The storage medium stores a computer program, and the computer program performs the steps of the method for eliminating the cord in the specified direction based on the extreme value filtering according to any one of claims 1-5 when the processor runs the computer program.
Citation Information
Patent Citations
Tire for construction vehicle
JP2017065637A
Image processing method and apparatus, electronic device, and readable storage medium
WO2022100048A1