Angle detection method for complex background

Through global and local threshold segmentation and morphological operations, the edges and angles of the steel wire cords are extracted, which solves the problem of cord image processing under complex backgrounds and improves production efficiency and quality.

CN118212179BActive Publication Date: 2024-12-13TIMACO (BEIJING) IND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410166234.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-05
Publication Date
2024-12-13
Estimated Expiration
2044-02-05

AI Technical Summary

Technical Problem

The image processing of steel wire cord images is difficult due to light effects and complex textures, which affects the efficiency of manufacturing and production processes.

Method used

The bright background area is determined by using global thresholds and local thresholds. The edge of the cord is extracted through segmentation, corrosion, expansion and difference set operations, and the skeleton and contour are divided to obtain the angle of the cord.

Benefits of technology

Accurate measurement and analysis of the angle of the steel cord is achieved, and the efficiency and quality of the manufacturing and production process are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118212179B_ABST
    Figure CN118212179B_ABST
Patent Text Reader

Abstract

The invention provides an angle detection method for a complex background, belonging to the technical field of angle detection. The method comprises the following steps: roughly extracting a steel cord image by a global threshold method, obtaining a bright background area in the steel cord image by a local threshold method, segmenting and preprocessing the bright background area based on the roughly extracted area, and obtaining a foreground cord area of ​​the steel cord image; performing corrosion operations and expansion operations on the foreground cord area, performing difference operations on the expansion image and the corrosion image, obtaining a cord edge area, extracting the edge of the cord edge area, and converting it into a connected area; performing difference operations on the cord edge area and the connected area, extracting a final cord area, and performing line segmentation on the outline of the final cord area in combination with the skeleton of the final cord area; and obtaining a cord angle of the final cord area based on all segmented line segments, which is helpful to extract more valuable information from the steel cord image and improve the efficiency and quality of the manufacturing and production processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of angle detection, and in particular to an angle detection method for complex backgrounds. Background Art

[0002] Steel cord is an important part of the tire. Its structure and performance play a key role in the performance of the tire. Accurately analyzing and extracting steel cord image information is of great significance for optimizing tire design and improving production efficiency. Steel cord images are difficult to process due to the lighting effect of steel wires and the complex texture caused by the interweaving and interlacing of steel wire bundles, which affects the efficiency of the manufacturing and production process.

[0003] Therefore, the present invention provides an angle detection method for complex background angles. Summary of the invention

[0004] The present invention provides an angle detection method for complex backgrounds, which is used to determine a bright background area in a steel cord image by setting a global threshold and a local threshold, segment the bright background area to obtain a foreground cord area, perform corrosion and expansion operations to determine the cord edge area and convert it into a connected area, perform a difference operation on the connected area and the cord edge area to obtain a final cord area, extract and segment the skeleton and contour of the final cord area to obtain the cord angle, and achieve accurate measurement and analysis of the angle and other properties of the steel cord, which is helpful to extract more valuable information from the steel cord image, thereby improving the efficiency and quality of the manufacturing and production processes.

[0005] The present invention provides a method for angle detection in a complex background, comprising:

[0006] Step 1: A global threshold method is used to roughly extract the steel cord fabric image, and at the same time, a local threshold method is used to obtain a bright background area in the steel cord fabric image;

[0007] Step 2: Segmenting and preprocessing the bright background area based on the coarse extraction area, and obtaining the foreground cord area of ​​the steel cord image;

[0008] Step 3: performing an erosion operation and a dilation operation on the foreground curtain area, and performing a difference operation on the dilated image and the eroded image to obtain a curtain edge area, and performing edge extraction on the curtain edge area to convert it into a connected area;

[0009] Step 4: performing a difference operation on the edge area of ​​the cord and the connected area to extract the final cord area, and performing line segmentation on the outline of the final cord area in combination with the skeleton of the final cord area;

[0010] Step 5: Calculate the curtain angle of the final curtain area based on all segmentation line segments.

[0011] The present invention provides an angle detection method for complex backgrounds, which uses a global threshold method to perform rough extraction on a steel cord fabric image, including:

[0012] Acquire original images of steel cords in various production processes, convert the original images into grayscale images, traverse each pixel of the grayscale image, and count the number of pixels corresponding to the grayscale level;

[0013] Using the number of pixels as the ordinate and the gray level as the abscissa, a gray histogram is drawn, and the gray histogram is normalized to determine the pixel probability distribution of each gray level;

[0014] Each gray level is used as an initial threshold to segment the gray image into two parts, namely, a target and a background. According to the segmentation results, the target pixel variance and the background pixel variance under each initial threshold are calculated respectively. The target pixel variance and the background pixel variance under the same initial threshold are summed. The initial threshold corresponding to the maximum sum is selected and combined with the pixel probability distribution to determine the global threshold.

[0015] The pixels in the steel cord image that are greater than or equal to the global threshold are set as the initial foreground, and the pixels that are less than the global threshold are set as the initial background, so as to achieve coarse extraction.

[0016] The present invention provides a method for detecting angles of complex backgrounds, which uses a local threshold method to obtain a bright background area in the steel cord fabric image, comprising:

[0017] Locking the transition portion between the initial foreground and the initial background and the edge portion of the grayscale image;

[0018] Performing pixel uniformity analysis on the grayscale image, and locking pixel blocks in the grayscale image whose uniformity is lower than a preset degree and block positions and block perimeters of the pixel blocks according to the analysis result;

[0019] Determine a first position and a first size of the edge portion, and simultaneously determine a second position and a second size of the transition portion;

[0020] Determine a division coefficient according to the block position, the block perimeter, and the uniformity of the block, and in combination with the first position, the second position, the first size, and the second size;

[0021] ; Wherein, HJ is the division coefficient; N1 is the number of pixel blocks whose uniformity is lower than the preset degree; is the total number of pixel blocks in the grayscale image; Indicates the uniformity of the k-th pixel block; 1 indicates the preset degree; represents a uniform variable based on uniformity; It represents the coefficient of uniformity difference level; Represents the block position based on the k-th pixel block and block perimeter The coefficient calculation function of ; Indicates the variance of the coefficient-based calculation function for the remaining pixel blocks except the k-th pixel block; represents a coefficient calculation function based on a first position d1 and a first size d11; represents a coefficient calculation function based on a second position d2 and a second size dd2;

[0022] Determine the division accuracy for dividing the edge portion and the transition portion from the coefficient-division unit mapping table to obtain a plurality of division blocks;

[0023] Calculate the effective value of pixel information of each divided block respectively;

[0024] ;in, Represents the effective value of pixel information of the i-th partition block; represents the optimal illumination value of the steel cord fabric image; represents the system-recognized illumination value of the i-th partition; Represents the importance function of the jth pixel of the i-th partition block; Represents the effective value function of the jth pixel of the i-th partition block; Represents the position information of the jth pixel of the i-th partition block; Represents the pixel value of the jth pixel of the i-th partition block; Represents the total number of pixels in the i-th partition block;

[0025] Based on the global threshold value, the local optimal threshold value of each partition block is searched, and at the same time, the maximum difference between the local initial threshold values ​​of adjacent partition blocks is set and the pixel information difference value of the corresponding adjacent partition blocks is calculated;

[0026] According to the local optimal threshold, the maximum difference, the effective value of the pixel information and the pixel information difference, the bright area in the steel cord image is collected;

[0027] A difference set is taken between the bright area and the coarse extraction area to obtain a bright background area.

[0028] The present invention provides a method for detecting angles of complex backgrounds, which segments and preprocesses the bright background area based on a coarse extraction area, and obtains a foreground cord area of ​​the steel cord image, including:

[0029] An intersection operation is performed between the area corresponding to the position of the steel cord and the bright background area, and the bright background area is restricted according to the intersection operation result;

[0030] Performing graphic recognition on the bright background area after the area restriction, segmenting the bright background area after the area restriction according to the recognition result, and matching the corresponding structural element to the recognition result;

[0031] Performing an opening operation on the corresponding segmented areas according to the structural element, merging the segmented areas based on the opening operation result, and performing background adjustment on the initial background according to the merging result to obtain a determined background area;

[0032] Taking the gray level corresponding to the maximum gray value in the gray histogram as a preset gray threshold;

[0033] Performing a difference between the grayscale image and the determined background area, performing background adjustment on the initial foreground according to the difference result to obtain a determined foreground area, and comparing the pixel grayscale value of the connection portion between the determined foreground area and the determined background area with a preset grayscale threshold, wherein the area of ​​the connection portion is affected by the light and shadow conditions when the steel cord image is obtained;

[0034] When the grayscale value of the pixel of the connected portion is greater than the preset grayscale value, determining that the pixel of the connected portion belongs to the first pixel of the adjusted foreground area;

[0035] When the grayscale value of the pixel of the connected portion is less than or equal to the preset grayscale threshold, determining that the pixel of the connected portion belongs to the second pixel of the determined background area;

[0036] The first pixel is combined with the determined foreground area to obtain a foreground curtain area.

[0037] The present invention provides a method for detecting angles of complex backgrounds, which performs an erosion operation and a dilation operation on the foreground curtain area, and performs a difference operation on the dilated image and the eroded image to obtain the curtain edge area, including:

[0038] Performing an erosion operation on the foreground curtain area, removing the bright area in the image, retaining the dark area, and shrinking the pixel boundary of the foreground curtain area inward by one pixel to obtain an eroded image;

[0039] Performing a dilation operation on the foreground curtain cloth, expanding the dark area, filling the gap at the edge of the curtain cloth, and expanding the boundary of the foreground curtain cloth area outward by one pixel to obtain a dilated image;

[0040] The difference operation is performed on the dilated image and the eroded image to obtain the morphological difference image and the edge area of ​​the curtain.

[0041] The present invention provides an angle detection method for a complex background, which extracts edges from the edge area of ​​the curtain and converts them into connected areas, including:

[0042] Performing morphological reconstruction on the morphological difference image to obtain a reconstructed difference image, acquiring edge feature points of the reconstructed difference image, and taking the centers of two adjacent edge feature points among the edge feature points as sampling points of the reconstructed difference image;

[0043] Calculating visual features of the steel cord according to edge feature points of the reconstructed difference image and the sampling points, wherein the visual features include contour features and color features;

[0044] Based on the visual features, the Canny operator is used to extract and screen the edge area of ​​the curtain fabric, and the filtered edge contour is closed and opened to convert it into a connected area.

[0045] The present invention provides a method for detecting angles of a complex background, which performs line segmentation on the outline of the final curtain area in combination with the skeleton of the final curtain area, comprising:

[0046] Setting capture conditions for the steel cord based on the center point of the final cord area, and using a skeleton extraction algorithm to extract target pixels that meet the set conditions, wherein the target pixels are integrated to form a skeleton of the final cord area;

[0047] The skeleton is converted into a sub-pixel contour, and the sub-pixel contour is segmented using a straight line fitting and a curve fitting method;

[0048] The direction vector of each segmented line segment is obtained, and it is determined whether the direction vectors are collinear. The collinear line segments are merged according to the determination result to obtain a segmentation line.

[0049] The present invention provides a method for detecting angles of complex backgrounds, which obtains the curtain angle of the final curtain area based on all segmentation line segments, including:

[0050] Conditionally screening the segmentation lines, determining the head-to-tail connection between the direction vectors corresponding to all the segmentation lines, and connecting the segmentation lines according to the head-to-tail connection;

[0051] Match the connected line segment with the contour line of the steel cord fabric, and determine the initial angle of the cord fabric according to the matching result;

[0052] Traverse the angles between all direction vectors, take the mode as the basic angle, set the basic angle radiation range, count all angles and the number of corresponding angles within the basic angle radiation range, perform normal distribution based on the statistical results, and determine the distribution angle;

[0053] The initial angle and the distribution angle are averaged to obtain the final cord angle for the cord area.

[0054] Compared with the prior art, the beneficial effects of the present application are as follows: by setting a global threshold and a local threshold to determine the bright background area in the steel cord image, the bright background area is segmented to obtain the foreground cord area, and corrosion and expansion operations are performed to determine the cord edge area and convert it into a connected area, and a difference operation is performed on the connected area and the cord edge area to obtain the final cord area, and the skeleton and contour of the final cord area are extracted and segmented to obtain the cord angle, thereby achieving accurate measurement and analysis of the angle and other properties of the steel cord, which helps to extract more valuable information from the steel cord image, thereby improving the efficiency and quality of the manufacturing and production processes.

[0055] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.

[0056] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0058] Figure 1 is a flow chart of a method for angle detection of a complex background in an embodiment of the present invention;

[0059] Figure 2 is an image of a steel cord in an embodiment of the present invention;

[0060] Figure 3 is a position information diagram of a steel cord in an embodiment of the present invention;

[0061] Figure 4 is a bright background area diagram in an embodiment of the present invention;

[0062] Figure 5 is a merging result diagram in an embodiment of the present invention;

[0063] Figure 6 is a diagram of the edge area of ​​the cord in an embodiment of the present invention;

[0064] Figure 7 is a contour area diagram in an embodiment of the present invention;

[0065] Figure 8This is a final cord area diagram in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0067] Embodiment 1:

[0068] The embodiment of the present invention provides a method for angle detection in a complex background. Figure 1 As shown, including:

[0069] Step 1: A global threshold method is used to roughly extract the steel cord fabric image, and at the same time, a local threshold method is used to obtain a bright background area in the steel cord fabric image;

[0070] Step 2: Segmenting and preprocessing the bright background area based on the coarse extraction area, and obtaining the foreground cord area of ​​the steel cord image;

[0071] Step 3: performing an erosion operation and a dilation operation on the foreground curtain area, and performing a difference operation on the dilated image and the eroded image to obtain a curtain edge area, and performing edge extraction on the curtain edge area to convert it into a connected area;

[0072] Step 4: performing a difference operation on the edge area of ​​the cord and the connected area to extract the final cord area, and performing line segmentation on the outline of the final cord area in combination with the skeleton of the final cord area;

[0073] Step 5: Calculate the curtain angle of the final curtain area based on all segmentation line segments.

[0074] In this embodiment, the global threshold is a threshold selected for the entire image. Pixels greater than the threshold are regarded as foregrounds, and pixels less than the threshold are regarded as backgrounds. The global threshold is selected based on the histogram analysis of the image to segment the target area as accurately as possible.

[0075] In this embodiment, the difference operation is a subtraction operation between images, that is, using one image to subtract the value in another image.

[0076] In this embodiment, the local threshold method selects a specific threshold for each small area of ​​the image to adapt to the differences in characteristics such as illumination and texture of each area.

[0077] In this embodiment, preprocessing is a series of optimization operations performed on the obtained pre-extracted area, generally including filtering, smoothing, etc., to eliminate or reduce noise and improve image quality.

[0078] In this embodiment, the background area refers to an area in the image that is regarded as the background and has a higher grayscale value or higher brightness.

[0079] In this embodiment, the segmentation process is to segment the grayscale image according to the initial threshold value corresponding to the grayscale level. If the grayscale value of a pixel is greater than (or greater than or equal to) the initial threshold value, the pixel is marked as foreground, usually represented by white; if the grayscale value of a pixel is less than the initial threshold value, the pixel is marked as background, usually represented by black.

[0080] In this embodiment, the curtain edge area is the foreground curtain area after the erosion and dilation operations. The erosion will make the curtain area thinner, and the dilation will make the curtain area larger. The result is a difference operation between the expanded image and the eroded image.

[0081] In this embodiment, the final curtain area is obtained by performing a difference operation on the curtain edge area and the connected area, eliminating those areas that do not belong to the curtain itself but are connected to the curtain, such as noise points or background objects in the image.

[0082] The working principle and beneficial effects of the above technical solution are: by setting global thresholds and local thresholds to determine the bright background area in the steel cord image, the bright background area is segmented to obtain the foreground cord area, and corrosion and expansion operations are performed to determine the cord edge area and convert it into a connected area, and the connected area is combined with the cord edge area to perform a difference operation to obtain the final cord area, and the skeleton and contour of the final cord area are extracted and segmented to obtain the cord angle, thereby achieving accurate measurement and analysis of the angle and other properties of the steel cord, which helps to extract more valuable information from the steel cord image, thereby improving the efficiency and quality of the manufacturing and production processes.

[0083] Embodiment 2:

[0084] The embodiment of the present invention provides an angle detection method for a complex background, which uses a global threshold method to perform rough extraction on a steel cord fabric image, including:

[0085] Acquire original images of steel cords in various production processes, convert the original images into grayscale images, traverse each pixel of the grayscale image, and count the number of pixels corresponding to the grayscale level;

[0086] Using the number of pixels as the ordinate and the gray level as the abscissa, a gray histogram is drawn, and the gray histogram is normalized to determine the pixel probability distribution of each gray level;

[0087] Each gray level is used as an initial threshold to segment the gray image into two parts, namely, a target and a background. According to the segmentation results, the target pixel variance and the background pixel variance under each initial threshold are calculated respectively. The target pixel variance and the background pixel variance under the same initial threshold are summed. The initial threshold corresponding to the maximum sum is selected and combined with the pixel probability distribution to determine the global threshold.

[0088] The pixels in the steel cord image that are greater than or equal to the global threshold are set as the initial foreground, and the pixels that are less than the global threshold are set as the initial background, so as to achieve coarse extraction.

[0089] In this embodiment, the grayscale image of the original image is Figure 2 .

[0090] In this embodiment, the grayscale level is also called the grayscale value, which is a numerical value that describes the brightness of a pixel in an image. When a color image is converted into a grayscale image, the grayscale level usually ranges from 0 to 255, where 0 represents black, 255 represents white, and other values ​​represent different degrees of gray. In a grayscale image, the color of each pixel is represented by a separate numerical value (i.e., the grayscale level).

[0091] In this embodiment, the production process includes multiple steps in the steel cord production process, such as raw material preparation, mixing, molding, welding, heat treatment, cooling, etc.

[0092] In this embodiment, the normalization of the grayscale histogram is ,in Represents the new grayscale value; Indicates the current grayscale value; Indicates the minimum gray value; Indicates the maximum gray value; .

[0093] In this embodiment, the global threshold is the sum of the target pixel variance and the background pixel variance under each initial threshold. The larger the sum, the greater the grayscale difference between the target area and the background area in the image under this threshold, and the easier it is to distinguish. All possible grayscale values ​​are traversed as thresholds, the sum of variances under each threshold is recorded, and the threshold with the largest sum of variances is selected as the global threshold. Under this threshold, the difference between the target area and the background area of ​​the image is most obvious.

[0094] In this embodiment, the rough extraction is to perform preliminary classification and extraction on the image without further processing or analysis. At this stage, some background pixels or noise pixels may still be misclassified into the foreground, or some foreground pixels may be misclassified into the background. The result of the rough extraction is as follows: Figure 3 shown.

[0095] The working principle and beneficial effects of the above technical solution are: by converting the steel cord image into a grayscale image, counting the number of pixels corresponding to the grayscale level, constructing a grayscale histogram, screening the initial threshold corresponding to the grayscale level to obtain a global threshold, and determining the initial background and initial foreground according to the global threshold, it is helpful to quickly and effectively extract the key information of the cord from the original image of the steel cord, and provide an important data basis for subsequent cord detection, analysis and quality control.

[0096] Embodiment 3:

[0097] The embodiment of the present invention provides a method for angle detection of complex background, which uses a local threshold method to obtain the bright background area in the steel cord fabric image, such as Figure 4 As shown, including:

[0098] Locking the transition portion between the initial foreground and the initial background and the edge portion of the grayscale image;

[0099] Performing pixel uniformity analysis on the grayscale image, and locking pixel blocks in the grayscale image whose uniformity is lower than a preset degree and block positions and block perimeters of the pixel blocks according to the analysis result;

[0100] Determine a first position and a first size of the edge portion, and simultaneously determine a second position and a second size of the transition portion;

[0101] Determine a division coefficient according to the block position, the block perimeter, and the uniformity of the block, and in combination with the first position, the second position, the first size, and the second size;

[0102] ; Wherein, HJ is the division coefficient; N1 is the number of pixel blocks whose uniformity is lower than the preset degree; is the total number of pixel blocks in the grayscale image; Indicates the uniformity of the k-th pixel block; 1 indicates the preset degree; represents a uniform variable based on uniformity; It represents the coefficient of uniformity difference level; Represents the block position based on the k-th pixel block and block perimeter The coefficient calculation function of ; Indicates the variance of the coefficient-based calculation function for the remaining pixel blocks except the k-th pixel block; represents a coefficient calculation function based on a first position d1 and a first size d11; represents a coefficient calculation function based on a second position d2 and a second size dd2;

[0103] Determine the division accuracy for dividing the edge portion and the transition portion from the coefficient-division unit mapping table to obtain a plurality of division blocks;

[0104] Calculate the effective value of pixel information of each divided block respectively;

[0105] ;in, Represents the effective value of pixel information of the i-th partition block; represents the optimal illumination value of the steel cord fabric image; represents the system-recognized illumination value of the i-th partition; Represents the importance function of the jth pixel of the i-th partition block; Represents the effective value function of the jth pixel of the i-th partition block; Represents the position information of the jth pixel of the i-th partition block; Represents the pixel value of the jth pixel of the i-th partition block; Represents the total number of pixels in the i-th partition block;

[0106] Based on the global threshold value, the local optimal threshold value of each partition block is searched, and at the same time, the maximum difference between the local initial threshold values ​​of adjacent partition blocks is set and the pixel information difference value of the corresponding adjacent partition blocks is calculated;

[0107] According to the local optimal threshold, the maximum difference, the effective value of the pixel information and the pixel information difference, the bright area in the steel cord image is collected;

[0108] A difference set is taken between the bright area and the coarse extraction area to obtain a bright background area.

[0109] In this embodiment, pixel uniformity analysis may refer to a method of evaluating the uniformity or distribution of image pixel intensity (eg, grayscale value) in image processing to help identify specific areas in the image, such as edges, textures, or other features.

[0110] In this embodiment, the coefficient-division unit mapping table includes division precision and corresponding division coefficients. The division precision may be a corresponding processing parameter, for example, indicating how many blocks the image is divided into or other processing precisions.

[0111] In this embodiment, the first position refers to the position of the edge part in the image. Common representation methods include using the centroid coordinates of the edge part or the position coordinates of a representative point (such as the leftmost, rightmost, topmost, bottommost, etc.); the first size refers to the area, length, circumference or other measurements representing the size of the edge part.

[0112] In this embodiment, the second position refers to the position of the transition part in the entire image, expressed as the coordinates of the center point or other representative position point of the area; the second size may refer to the area, perimeter, length or other measurement that can represent the scale of the transition part. For example, for a seam line, the size refers to its length.

[0113] In this embodiment, the pixel information difference refers to the difference in pixel values ​​between different partition blocks or within the same partition block, or the difference in other pixel-related measurement factors (such as brightness, color, contrast, etc.). For example, if we are comparing the difference between two partition blocks, the pixel information difference may be the difference between the average pixel values ​​of the two partition blocks, or the difference in a certain measurement factor.

[0114] In this embodiment, the maximum difference is used to evaluate whether the pixel information difference is small enough. If the pixel information difference exceeds the maximum difference, it is considered that the two partitioned blocks are visually significantly different and cannot be classified into the same category. If the pixel information difference does not exceed the maximum difference, it is possible that the two partitioned blocks are visually similar and can be classified into the same category.

[0115] The working principle and beneficial effects of the above technical solution are: by determining the position and perimeter of the pixel blocks whose uniformity of the transition part and the edge part is lower than the preset degree, calculating the corresponding division coefficient, dividing the area with the corresponding division accuracy, calculating the effective value of the corresponding division block, combining the effective value, the local optimal threshold, the maximum difference, and the pixel information difference to obtain the bright area in the steel cord image, and obtaining the bright background area after taking the difference set, the steel cord can be accurately extracted from the complex production environment, which helps to improve the efficiency and quality of the manufacturing and production processes.

[0116] Embodiment 4:

[0117] The embodiment of the present invention provides a method for detecting angles in a complex background, which segments and preprocesses the bright background area based on the coarse extraction area, and obtains the foreground cord area of ​​the steel cord image, such as Figure 5 As shown, including:

[0118] An intersection operation is performed between the area corresponding to the position of the steel cord and the bright background area, and the bright background area is restricted according to the intersection operation result;

[0119] Performing graphic recognition on the bright background area after the area restriction, segmenting the bright background area after the area restriction according to the recognition result, and matching the corresponding structural element to the recognition result;

[0120] Performing an opening operation on the corresponding segmented areas according to the structural element, merging the segmented areas based on the opening operation result, and performing background adjustment on the initial background according to the merging result to obtain a determined background area;

[0121] Taking the gray level corresponding to the maximum gray value in the gray histogram as a preset gray threshold;

[0122] Performing a difference between the grayscale image and the determined background area, performing background adjustment on the initial foreground according to the difference result to obtain a determined foreground area, and comparing the pixel grayscale value of the connection portion between the determined foreground area and the determined background area with a preset grayscale threshold, wherein the area of ​​the connection portion is affected by the light and shadow conditions when the steel cord image is obtained;

[0123] When the grayscale value of the pixel of the connected portion is greater than the preset grayscale value, determining that the pixel of the connected portion belongs to the first pixel of the adjusted foreground area;

[0124] When the grayscale value of the pixel of the connected portion is less than or equal to the preset grayscale threshold, determining that the pixel of the connected portion belongs to the second pixel of the determined background area;

[0125] The first pixel is combined with the determined foreground area to obtain a foreground curtain area.

[0126] In this embodiment, the region limitation is a constraint on the image processing range in order to reduce unnecessary calculation amount and improve processing accuracy.

[0127] In this embodiment, the pattern recognition is to recognize the approximate image of the segmented area, and common shapes include square, circle, and ellipse.

[0128] In this embodiment, the structural element is a small binary or grayscale image used to scan and process the original image. It has various shapes and sizes, and common ones are square, circle, ellipse or a line. The structural element is matched to the recognition result by using the structural element to match the shape, size and other characteristics of the identified bright background area when performing morphological operations.

[0129] In this embodiment, the opening operation is a basic operation in morphology, which is used to eliminate small objects, separate objects at thin points, and smooth the boundaries of larger objects.

[0130] In this embodiment, the background adjustment is performed because the connecting part is usually an edge or a transition area, which may contain some foreground and some background. If the pixel grayscale value of the connecting part is greater than the preset grayscale value, this part of the pixels actually belongs to the foreground and should be included in the foreground area. These pixels are called first pixels; if the pixel grayscale value of the connecting part is less than or equal to the preset grayscale value, this part of the pixels actually belongs to the background and should be eliminated from the foreground area. These pixels are called second pixels.

[0131] The working principle and beneficial effects of the above technical solution are: by performing area restriction and graphic recognition on the bright background area, matching the corresponding structural elements for opening operation, merging the segmented areas based on the operation results to determine the background area, performing a difference set between the grayscale image and the determined background area to determine the foreground area, performing a difference set operation on the two and determining the connected part, refining the connected part to obtain the foreground cord area, so as to achieve accurate extraction of the steel cord from the complex production environment, which helps to improve the efficiency and quality of the manufacturing and production processes.

[0132] Embodiment 5:

[0133] The embodiment of the present invention provides a method for detecting angles in a complex background, wherein the foreground curtain region is subjected to an erosion operation and a dilation operation, and a difference operation is performed on the dilated image and the eroded image to obtain the curtain edge region, such as Figure 6 As shown, including:

[0134] Performing an erosion operation on the foreground curtain area, removing the bright area in the image, retaining the dark area, and shrinking the pixel boundary of the foreground curtain area inward by one pixel to obtain an eroded image;

[0135] Performing a dilation operation on the foreground curtain cloth, expanding the dark area, filling the gap at the edge of the curtain cloth, and expanding the boundary of the foreground curtain cloth area outward by one pixel to obtain a dilated image;

[0136] The difference operation is performed on the dilated image and the eroded image to obtain the morphological difference image and the edge area of ​​the curtain.

[0137] In this embodiment, the dilation operation will expand the foreground area in the image, while the erosion operation will shrink these areas. The images after the erosion and dilation operations are not completely consistent. Subtracting the eroded image from the dilated image will leave the edge part of the image, which is the morphological difference map.

[0138] The working principle and beneficial effects of the above technical solution are: by corroding and dilating the foreground cord area, performing difference operations on the eroded image and the dilated image to determine the cord edge area, noise removal, shape and edge feature extraction and other functions are achieved for the image foreground area (i.e., the steel cord area), providing a more accurate and clear target area for subsequent image analysis.

[0139] Embodiment 6:

[0140] The embodiment of the present invention provides a method for angle detection of a complex background, which extracts edges from the edge area of ​​the curtain and converts them into connected areas, including:

[0141] Performing morphological reconstruction on the morphological difference image to obtain a reconstructed difference image, acquiring edge feature points of the reconstructed difference image, and taking the centers of two adjacent edge feature points among the edge feature points as sampling points of the reconstructed difference image;

[0142] Calculating visual features of the steel cord according to edge feature points of the reconstructed difference image and the sampling points, wherein the visual features include contour features and color features;

[0143] Based on the visual features, the Canny operator is used to extract and screen the edge area of ​​the curtain fabric, and the filtered edge contour is closed and opened to convert it into a connected area.

[0144] In this embodiment, morphological reconstruction includes marking an image, selecting a variant of the original image, called the marked image, which is smaller than the original image (i.e., internal, eroded); restricting the transformation, and then performing morphological dilation on the marked image, but this dilation is restricted by the original image, i.e., the result of the dilation cannot exceed the original image, and continuing this process until the resulting image stabilizes.

[0145] In this embodiment, the edge feature point refers to a point at the edge of an image, which is a portion with obvious and prominent edges in the difference image after morphological reconstruction. It is located at the edge of an object and is highly representative of the description of the shape of the object.

[0146] In this embodiment, the Canny operator is a common edge detection operator, which can effectively detect edge information in an image.

[0147] In this embodiment, the contour feature is the external characteristics of the object shape, and common ones include area, perimeter, moment (such as central moment, color moment, etc.), diameter, thickness, etc., and also include centroid, ellipse fitting, convex hull, minimum rectangular envelope, etc. The contour feature extraction of the image can usually provide the general information of the object shape. The extracted contour area is as follows: Figure 7 as shown in .

[0148] In this embodiment, the color feature is the internal characteristic of the object's color, and common ones include color histogram, color moment, color correlation diagram, color consistency, etc. If the color of the object is significant and representative for the object, then the color feature is often regarded as a very important feature.

[0149] The working principle and beneficial effects of the above technical solution are: by morphologically reconstructing the morphological difference image to determine the edge feature points, and determining the visual features corresponding to the steel cord fabric, edge extraction and screening are performed to achieve the extraction and optimization of the edge features of the cord fabric, and obtain more accurate visual features of the cord fabric. At the same time, the obtained edge information is further extracted and processed, so that more accurate cord fabric shape and edge information can be obtained, thereby improving the efficiency and quality of the manufacturing and production processes.

[0150] Embodiment 7:

[0151] An embodiment of the present invention provides an angle detection method for a complex background, which performs line segmentation on the outline of the final curtain area in combination with the skeleton of the final curtain area, including:

[0152] Setting capture conditions for the steel cord based on the center point of the final cord area, and using a skeleton extraction algorithm to extract target pixels that meet the set conditions, wherein the target pixels are integrated to form a skeleton of the final cord area;

[0153] The skeleton is converted into a sub-pixel contour, and the sub-pixel contour is segmented using a straight line fitting and a curve fitting method;

[0154] The direction vector of each segmented line segment is obtained, and it is determined whether the direction vectors are collinear. The collinear line segments are merged according to the determination result to obtain a segmentation line.

[0155] In this embodiment, the capture conditions include the position of the pixel, for example, only focusing on pixels within a certain distance range from the center point; the brightness or color of the pixel: for example, only focusing on pixels whose brightness or color exceeds (or is lower than) a certain threshold; the state of other pixels around the pixel: for example, only focusing on pixels at the edge (i.e., there are bright and dark pixels around), or only focusing on pixels at the center of a certain texture.

[0156] In this embodiment, the skeleton extraction algorithm includes thinning technology, morphological operation, distance transformation, etc.

[0157] In this embodiment, sub-pixel contour is a method for more precisely positioning and describing edges or contours. It uses the local grayscale change information of the image and, through interpolation and other methods, infers the specific position of the edge between pixels. For example, a straight line in an image may not pass exactly through the center points of each pixel. Through sub-pixel edge detection, the position of this line can be accurately depicted.

[0158] The working principle and beneficial effects of the above technical solution are: by setting capture conditions for the final curtain area to extract the skeleton, the skeleton is transformed, and then the contour is segmented, and the collinear line segments with the same direction vector are merged according to the direction vector of the segmented line segments to obtain the segmentation line, which helps to better understand and analyze image information and improve the efficiency and accuracy of image processing.

[0159] Embodiment 8:

[0160] The embodiment of the present invention provides a method for angle detection in a complex background, which obtains the curtain angle of the final curtain area based on all segmentation line segments, such as Figure 8 As shown, including:

[0161] Conditionally screening the segmentation lines, determining the head-to-tail connection between the direction vectors corresponding to all the segmentation lines, and connecting the segmentation lines according to the head-to-tail connection;

[0162] Match the connected line segment with the contour line of the steel cord fabric, and determine the initial angle of the cord fabric according to the matching result;

[0163] Traverse the angles between all direction vectors, take the mode as the basic angle, set the basic angle radiation range, count all angles and the number of corresponding angles within the basic angle radiation range, perform normal distribution based on the statistical results, and determine the distribution angle;

[0164] The initial angle and the distribution angle are averaged to obtain the final cord angle for the cord area.

[0165] In this embodiment, the basic angular radiation range is ±30 degrees.

[0166] In this embodiment, the first connection situation includes the tail of the line segment (end point) and the head of another line segment (starting point), indicating that the two line segments form a continuous contour; the head of the line segment is connected to the head of another line segment, or the tail is connected to the tail, indicating that the contour of the curtain has some complex shapes here, such as folding or crossing; a part of the line segment (not the head and tail) is connected to the head or tail of another line segment, indicating that there are some errors in the segmentation of the line segment and correction is needed.

[0167] In this embodiment, the process of determining the initial angle is to find the right-angle side and the hypotenuse of the steel cord fabric and determine the angle between the two edges.

[0168] The working principle and beneficial effects of the above technical solution are: screening the dividing lines to determine the contour lines, determining the initial angle based on the contour lines, calculating the angle of the direction vector, normally distributing the calculated results, determining the distribution angle, and averaging the two to obtain the curtain angle, which is helpful for analyzing and describing the curtain and improving the efficiency and quality of the manufacturing and production processes.

[0169] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for angle detection in complex background, characterized in that: include: Step 1: A global threshold method is used to roughly extract the steel cord fabric image, and at the same time, a local threshold method is used to obtain a bright background area in the steel cord fabric image; Step 2: Segmenting and preprocessing the bright background area based on the coarse extraction area, and obtaining the foreground cord area of ​​the steel cord image; Step 3: performing an erosion operation and a dilation operation on the foreground curtain area, and performing a difference operation on the dilated image and the eroded image to obtain a curtain edge area, and performing edge extraction on the curtain edge area to convert it into a connected area; Step 4: performing a difference operation on the edge area of ​​the cord and the connected area to extract the final cord area, and performing line segmentation on the outline of the final cord area in combination with the skeleton of the final cord area; Step 5: Calculating the curtain angle of the final curtain area based on all segmentation line segments; Wherein, the bright background area in the steel cord fabric image is obtained by adopting a local threshold method, including: Lock the transition between the initial foreground and the initial background and the edge of the grayscale image; Performing pixel uniformity analysis on the grayscale image, and locking pixel blocks in the grayscale image whose uniformity is lower than a preset degree and block positions and block perimeters of the pixel blocks according to the analysis result; Determine a first position and a first size of the edge portion, and simultaneously determine a second position and a second size of the transition portion; Determine a division coefficient according to the block position, the block perimeter, and the uniformity of the block, and in combination with the first position, the second position, the first size, and the second size; ; Wherein, HJ is the division coefficient; N1 is the number of pixel blocks whose uniformity is lower than the preset degree; is the total number of pixel blocks in the grayscale image; Indicates the uniformity of the k-th pixel block; 1 indicates the preset degree; represents a uniform variable based on uniformity; It represents the coefficient of uniformity difference level; Represents the block position based on the k-th pixel block and block perimeter The coefficient calculation function of ; Indicates the variance of the coefficient-based calculation function for the remaining pixel blocks except the k-th pixel block; represents a coefficient calculation function based on a first position d1 and a first size d11; represents a coefficient calculation function based on a second position d2 and a second size dd2; Determine the division accuracy for dividing the edge portion and the transition portion from the coefficient-division unit mapping table to obtain a plurality of division blocks; Calculate the effective value of pixel information of each divided block respectively; ;in, Represents the effective value of pixel information of the i-th partition block; represents the optimal illumination value of the steel cord fabric image; represents the system-recognized illumination value of the i-th partition; Represents the importance function of the jth pixel of the i-th partition block; Represents the effective value function of the jth pixel of the i-th partition block; Represents the position information of the jth pixel of the i-th partition block; Represents the pixel value of the jth pixel of the i-th partition block; Represents the total number of pixels in the i-th partition block; Based on the global threshold value, the local optimal threshold value of each partition block is searched, and at the same time, the maximum difference between the local initial threshold values ​​of adjacent partition blocks is set and the pixel information difference value of the corresponding adjacent partition blocks is calculated; According to the local optimal threshold, the maximum difference, the effective value of the pixel information and the pixel information difference, the bright area in the steel cord image is collected; Taking a difference set between the bright area and the coarse extraction area to obtain a bright background area; The pixel information difference refers to the difference in pixel values ​​between different partition blocks or within the same partition block, or the difference in other pixel-related measurement factors; The difference operation is a subtraction operation between images, which is to subtract the value in one image from the value in another image.

2. The method for detecting angles of complex backgrounds according to claim 1, characterized in that: The global threshold method is used to roughly extract the steel cord image, including: Acquire original images of steel cords in various production processes, convert the original images into grayscale images, traverse each pixel of the grayscale image, and count the number of pixels corresponding to the grayscale level; Using the number of pixels as the ordinate and the gray level as the abscissa, a gray histogram is drawn, and the gray histogram is normalized to determine the pixel probability distribution of each gray level; Each gray level is used as an initial threshold to segment the gray image into two parts, namely, a target and a background. According to the segmentation results, the target pixel variance and the background pixel variance under each initial threshold are calculated respectively. The target pixel variance and the background pixel variance under the same initial threshold are summed. The initial threshold corresponding to the maximum sum is selected and combined with the pixel probability distribution to determine the global threshold. The pixels in the steel cord image that are greater than or equal to the global threshold are set as the initial foreground, and the pixels that are less than the global threshold are set as the initial background, so as to achieve coarse extraction.

3. The method for angle detection of complex background according to claim 1, characterized in that: Performing an erosion operation and a dilation operation on the foreground curtain area, and performing a difference operation on the dilated image and the eroded image to obtain a curtain edge area, including: Performing an erosion operation on the foreground curtain area, removing the bright area in the image, retaining the dark area, and shrinking the pixel boundary of the foreground curtain area inward by one pixel to obtain an eroded image; Performing a dilation operation on the foreground curtain cloth, expanding the dark area, filling the gap at the edge of the curtain cloth, and expanding the boundary of the foreground curtain cloth area outward by one pixel to obtain a dilated image; The difference operation is performed on the dilated image and the eroded image to obtain the morphological difference image and the edge area of ​​the curtain.

4. The method for angle detection of complex background according to claim 3, characterized in that: The edge region of the curtain fabric is subjected to edge extraction and converted into a connected region, including: Performing morphological reconstruction on the morphological difference image to obtain a reconstructed difference image, acquiring edge feature points of the reconstructed difference image, and taking the centers of two adjacent edge feature points among the edge feature points as sampling points of the reconstructed difference image; Calculating visual features of the steel cord according to edge feature points of the reconstructed difference image and the sampling points, wherein the visual features include contour features and color features; Based on the visual features, the Canny operator is used to extract and screen the edge area of ​​the curtain fabric, and the filtered edge contour is closed and opened to convert it into a connected area.

5. The method for detecting angles of complex backgrounds according to claim 1, characterized in that: Performing line segmentation on the contour of the final cord area in combination with the skeleton of the final cord area includes: Setting capture conditions for the steel cord based on the center point of the final cord area, and using a skeleton extraction algorithm to extract target pixels that meet the set conditions, wherein the target pixels are integrated to form a skeleton of the final cord area; The skeleton is converted into a sub-pixel contour, and the sub-pixel contour is segmented using a straight line fitting and a curve fitting method; The direction vector of each segmented line segment is obtained, and it is determined whether the direction vectors are collinear. The collinear line segments are merged according to the determination result to obtain a segmentation line.

6. The method for angle detection of complex background according to claim 1, characterized in that: Obtaining the curtain angle of the final curtain area based on all segmented line segments includes: Conditionally screening the segmentation lines, determining the head-to-tail connection between the direction vectors corresponding to all the segmentation lines, and connecting the segmentation lines according to the head-to-tail connection; Match the connected line segment with the contour line of the steel cord fabric, and determine the initial angle of the cord fabric according to the matching result; Traverse the angles between all direction vectors, take the mode as the basic angle, set the basic angle radiation range, count all angles and the number of corresponding angles within the basic angle radiation range, perform normal distribution based on the statistical results, and determine the distribution angle; The initial angle and the distribution angle are averaged to obtain the final cord angle for the cord area.