Printing paperboard positioning method and system based on visual image segmentation and edge detection
By combining parallel and cross-polarized cameras with dual-channel neural networks and semantic segmentation technology, the glare problem on reflective substrates was solved, enabling high-precision positioning of printed paperboard and improving production efficiency.
Patent Information
- Application Number
- CN202511339855.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-09-19
AI Technical Summary
Existing visual positioning technologies are prone to glare when facing reflective substrates, leading to a decrease in image quality and affecting the positioning accuracy and production efficiency of printed paperboards.
Images are acquired using parallel polarization cameras and cross polarization cameras. Polarization features are extracted using a dual-channel neural network to generate a parallel glare mask and adjust the weights of the cross polarization features. The edge position of the printed paperboard is determined by combining feature fusion and semantic segmentation networks.
It significantly reduces glare interference, improves the reliability and positioning accuracy of image processing, reduces mechanical adjustment errors, and increases production efficiency.
Smart Images

Figure CN120833352A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of printed paperboard positioning, and particularly to a printed paperboard positioning method and system based on visual image segmentation and edge detection. BACKGROUND
[0002] In the automatic production process of the printing industry, accurate positioning of the printed paperboard is a key link to ensure the printing quality. With the continuous improvement of industrial automation, the accuracy and stability of the printed paperboard positioning are increasingly demanding.
[0003] In recent years, positioning methods based on visual images have gradually emerged. However, the existing visual positioning technology has obvious defects when facing a light-reflecting material base plate. Due to the characteristics of the light-reflecting material, glare phenomenon is easily generated in the image acquisition process. Glare will seriously interfere with image quality, causing errors in subsequent image processing algorithms (such as edge detection). For example, when performing edge detection positioning of the base plate, the image parameters of the glare area are abnormal, which will mislead the edge detection algorithm, causing the detected edge position to deviate from the actual physical edge, and thus affecting the positioning accuracy of the printed paperboard, and seriously restricting the improvement of printing quality and production efficiency.
[0004] At present, there is no good solution to the above problems. SUMMARY
[0005] Embodiments of the present application provide a printed paperboard positioning method and system based on visual image segmentation and edge detection, which are used to solve the glare phenomenon of printed paperboard positioning and improve the positioning accuracy of printed paperboard.
[0006] To achieve the above purpose, embodiments of the present application adopt the following technical solutions: In a first aspect, a printed paperboard positioning method based on visual image segmentation and edge detection is provided, which comprises: When the target substrate reaches the preset position, a parallel polarized camera and a cross-polarized camera are used to capture a parallel polarized image and a cross-polarized image of the target substrate, respectively; A preset double-channel neural network is used to determine parallel polarization features and cross-polarization features based on the parallel polarized image and the cross-polarized image, and a parallel glare mask is determined based on the parallel polarization features; The cross-polarization features are adjusted based on the parallel glare mask to obtain adjusted cross-polarization features; The adjusted cross-polarization features and the parallel polarization features are combined to obtain a fusion feature map; The fusion feature map is input into a preset semantic segmentation network model to obtain an edge probability map of the target substrate; According to the edge probability map, an edge position of the target substrate is determined by using a contour connection algorithm.
[0007] In a possible implementation of the first aspect, the parallel polarization features include parallel glare features and parallel non-glare features, the cross polarization features include cross glare features and cross non-glare features, and the combining the parallel polarization image and the cross polarization image to determine the parallel polarization features and the cross polarization features respectively by using the preset double-channel neural network and determining the parallel glare mask based on the parallel polarization features comprises the following steps. extracting, by using a first branch channel of the preset double-channel neural network, brightness features and reflection intensity features of the parallel polarization image; calculating, based on the brightness features and the reflection intensity features, brightness mean value and brightness standard deviation and reflection intensity mean value and reflection intensity standard deviation respectively; setting, in combination with the brightness mean value and the brightness standard deviation, a brightness threshold value and setting, in combination with the reflection mean value and the reflection standard deviation, a reflection intensity threshold value; regarding, as parallel glare regions, regions in the parallel polarization image in which the brightness features exceed the brightness threshold value and the reflection intensity features exceed the reflection intensity threshold value; extracting, by using a second branch channel of the preset double-channel neural network, cross glare features and cross non-glare features of the cross polarization image; determining the parallel glare mask according to the parallel glare regions; wherein the brightness features and the reflection intensity features of the parallel glare features in the parallel polarization image are maximum value features under preset conditions, and the texture features and the edge features of the cross glare features in the cross polarization image are maximum value features under preset conditions.
[0008] In a possible implementation of the first aspect, the extracting, by using the second branch channel of the preset double-channel neural network, the cross glare features and the cross non-glare features of the cross polarization image comprises the following steps. extracting, by using the second branch channel of the preset double-channel neural network, texture features and edge features of the cross polarization image; determining an edge gradient amplitude and an edge pixel connection degree according to the edge features; when the edge gradient amplitude is greater than or equal to a preset edge gradient threshold value and the edge pixel connection degree is greater than or equal to a preset edge connection degree threshold value, determining the cross non-glare features; when the edge gradient amplitude is less than the preset edge gradient threshold value and the edge pixel connection degree is less than the preset edge connection degree threshold value, determining the cross glare features; when the edge gradient amplitude is greater than or equal to the preset edge gradient threshold value and the edge pixel connection degree is less than the preset edge connection degree threshold value, calculating a texture complexity according to the texture features; When the texture complexity does not exceed the preset texture feature threshold, it is determined that the cross-glare feature exists; When the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold, the edge gray mean value is calculated according to the edge feature; When the edge gray mean value exceeds the preset gray threshold, it is determined that the cross-glare feature exists.
[0009] In a possible implementation of the first aspect, the step of adjusting the cross-polarization feature based on the parallel-glare mask to obtain an adjusted cross-polarization feature comprises the following steps: The parallel-glare mask is matched with the cross-polarization feature in spatial position to determine the spatial correspondence between each parallel-glare mask and the cross-polarization feature; The pixel value of the parallel-glare mask corresponding to the cross-polarization feature is determined according to the spatial correspondence; The cross-polarization feature value is determined based on the cross-polarization feature; The adjustment weight is calculated according to the pixel value of the parallel-glare mask and the preset weight factor; The product of the adjustment weight and the cross-polarization feature value is calculated to obtain the adjusted cross-polarization feature.
[0010] In a possible implementation of the first aspect, the step of combining the adjusted cross-polarization feature and the parallel-polarization feature to obtain a fused feature map comprises the following steps: The adjusted cross-polarization feature and the parallel-polarization feature are respectively constructed into a first feature hierarchical structure and a second feature hierarchical structure; The weight value of each feature in the first feature hierarchical structure and the weight value of each feature in the second feature hierarchical structure are calculated; The overall weight map is constructed by combining the weight value in the first feature hierarchical structure and the weight value in the second feature hierarchical structure; Based on the overall weight map, the first feature hierarchical structure and the second feature hierarchical structure, the features in the same level are spliced according to the corresponding level to obtain the fused features; The fused feature map is constructed according to the fused features.
[0011] In a possible implementation of the first aspect, the step of constructing the first feature hierarchical structure and the second feature hierarchical structure from the adjusted cross-polarization feature and the parallel-polarization feature comprises the following steps: The local brightness change feature and the local reflection intensity feature are extracted from the parallel-polarization feature, and the local brightness change feature and the local reflection intensity feature are taken as the first level features; The second level features are obtained by clustering analysis on the local brightness change feature and the local reflection intensity feature. extracting a brightness global feature and a reflection global feature as third-level features according to the parallel polarization feature; constructing a first feature hierarchical structure based on the first-level features, the second-level features and the third-level features; extracting a texture fine-grained feature and an edge fine-grained feature in combination with the adjusted cross-polarization feature, and taking the texture fine-grained feature and the edge fine-grained feature as fourth-level features; performing clustering analysis on the texture fine-grained feature and the edge fine-grained feature to obtain a texture local feature and an edge local contour feature, and taking the texture local feature and the edge local contour feature as fifth-level features; extracting an edge overall contour feature and a texture overall feature according to the adjusted cross-polarization feature to obtain sixth-level features; constructing a second feature hierarchical structure in combination with the fourth-level features, the fifth-level features and the sixth-level features.
[0012] In a possible implementation manner of the first aspect, the method further includes the following steps: transforming the edge probability map into an edge binary map, wherein a pixel point in the edge binary map with a probability value greater than or equal to a preset threshold value is regarded as an edge point, and a pixel point in the edge binary map with a probability value less than the preset threshold value is regarded as a non-edge point; traversing the edge binary map to determine discrete edge segments in the edge binary map by using a contour detection algorithm; calculating the length of each discrete edge segment, and taking a discrete edge segment with a length greater than a preset length threshold value as a valid discrete edge segment; calculating the distance between each valid discrete edge segment, and connecting valid discrete edge segments with a distance less than a preset distance threshold value to determine an initial edge position of the target substrate; performing edge fitting on the initial edge position based on a preset contour shape of the target substrate to determine the edge position of the target substrate.
[0013] In a possible implementation manner of the first aspect, the method further includes the following steps: determining a target vertex according to a preset contour shape of the target substrate; extracting a target vertex coordinate in combination with the edge position of the target substrate and the target vertex; determining an edge position area and an edge position shape according to the target vertex coordinate and the edge position of the target substrate; verifying the edge position of the target substrate in combination with the edge position area, the edge position shape and the preset contour shape; if the edge position area and the edge position shape pass the verification, determining the edge position of the target substrate.
[0014] In a second aspect, the present application provides a machine readable storage medium having instructions stored thereon for causing a machine to perform the above-mentioned method for locating printed paperboard based on visual image segmentation and edge detection.
[0015] In a third aspect, the present application provides an electronic device comprising: a memory configured to store instructions; and a processor configured to call the instructions from the memory and implement the above-mentioned method for locating printed paperboard based on visual image segmentation and edge detection when executing the instructions.
[0016] By the above technical solution, the characteristics of parallel and cross polarization cameras are utilized. The parallel polarization image is susceptible to glare caused by surface reflection, while the cross polarization image can suppress part of the glare but may lose details. By generating a parallel glare mask, the glare area in the parallel image can be accurately identified, and the weight of the cross feature can be adjusted. The advantages of the two polarization images can be effectively fused, the glare interference can be significantly reduced, and the reliability of image processing can be improved. By using a double-channel neural network to extract parallel and cross polarization features respectively, the parallel feature retains more surface texture details, and the cross feature highlights material differences. By feature fusion, the complementary information of the two features is integrated, avoiding the feature failure problem caused by surface reflection, texture blur or light changes in a single polarization mode, and improving the adaptability to complex surfaces. The fused feature map is input into a semantic segmentation network, which can output the probability of each pixel belonging to an edge, and can more accurately capture the fine edges and complex contours of the printed paperboard. Combined with a contour connection algorithm, discrete high-probability edge points can be connected into continuous closed contours, achieving more accurate positioning, reducing mechanical adjustment errors, and thus improving production efficiency.
[0017] Other features and advantages of the embodiments of the present application will be described in detail in the following specific implementation part. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 A flowchart of a method for locating printed paperboard based on visual image segmentation and edge detection provided by an embodiment of the present application is shown. Figure 2 A structure diagram of an apparatus for collecting parallel polarization images and cross polarization images of a target substrate provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiments of the present application and should not be used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0020] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative positional relationship, movement condition, etc. between components in a certain specific posture (as shown in the drawings), and if the specific posture changes, the directional indications also change accordingly.
[0021] In addition, if the embodiments of the present application involve descriptions such as “first”, “second”, etc., the descriptions of “first”, “second”, etc. are only for description purposes and should not be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features limited by “first” and “second” can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize it, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the scope of protection claimed by the present application.
[0022] Figure 1 A flowchart of a printing paperboard positioning method based on visual image segmentation and edge detection according to an embodiment of the present application is schematically shown. As shown in Figure 1 The present application provides a printing paperboard positioning method based on visual image segmentation and edge detection, which can include the following steps.
[0023] S110, when the target substrate reaches the preset position, a parallel polarization camera and a cross polarization camera are used to capture a parallel polarization image and a cross polarization image of the target substrate, respectively; S120, a parallel polarization feature and a cross polarization feature are determined by using a preset double-channel neural network in combination with the parallel polarization image and the cross polarization image, and a parallel glare mask is determined based on the parallel polarization feature; S130, the cross polarization feature is adjusted in feature weight based on the parallel glare mask to obtain an adjusted cross polarization feature; S140, a fusion feature map is obtained by fusing the adjusted cross polarization feature and the parallel polarization feature; S150, input the fusion feature map into a preset semantic segmentation network model to obtain an edge probability map of the target substrate; S160, determine the edge position of the target substrate according to the edge probability map using a contour connection algorithm.
[0024] When the target substrate reaches the preset position, the parallel polarized image and the cross polarized image of the target substrate are collected by using the pre-set parallel polarized camera and cross polarized camera respectively. The preset position refers to a fixed trigger point pre-set in the production line or detection equipment. When the target substrate moves to this position with the conveying belt, the subsequent image collection action will be triggered. The transmission axis direction of the polarized filter of the parallel polarized camera is parallel to the polarization direction of the incident light; the transmission axis direction of the polarized filter of the cross polarized camera is perpendicular to the polarization direction of the incident light. In this embodiment, an LED area light source with a linear polarized film is arranged above the station. At the camera end, a beam splitter is used to divide the light path into two parts, which are respectively introduced into two synchronously triggered cameras. A linear polarized film is placed in front of each of the two cameras, and the polarization directions of the two linear polarized films are perpendicular to each other (orthogonal). In this embodiment, the parallel polarized image can capture polarized light consistent with the transmission axis direction of the filter; the cross polarized image can capture polarized light perpendicular to the transmission axis direction of the filter; in this embodiment, the surface of the target substrate may be a substrate with gloss, and the reflected light has strong polarization characteristics, especially the horizontal or vertical glare. The parallel polarized image will retain more surface reflection glare information, but it may also lose details due to strong reflection, for example, the edge profile of the target substrate may be covered by glare, causing the edge profile of the target substrate to be covered and the position of the target substrate to be unable to be accurately identified. In the cross polarized image, since the filter is perpendicular to the polarization direction of the incident light, the surface reflection glare will be greatly weakened. Since the glare is mostly parallel polarized light, it cannot pass through the vertical filter, but the scattered light information of the target substrate material itself can be more clearly retained, and the edge profile of the target substrate can be more clearly identified.
[0025] Figure 2 A structure schematic diagram for collecting the parallel polarized image and the cross polarized image of the target substrate is provided in this embodiment. In the production line, the target substrate is placed on the station, and above the station is an LED area light source with a linear polarized film. Below the light source is a beam splitter, which divides the light path into two parts and connects them to the parallel polarized camera and the cross polarized camera respectively.
[0026] The preset dual-channel neural network is used to determine the parallel polarized features and the cross polarized features based on the parallel polarized image and the cross polarized image, and the parallel glare mask is determined based on the parallel polarized features. In the embodiment, the preset dual-channel neural network is a pre-designed neural network architecture, the input layer of which receives the parallel polarized image and the cross polarized image at the same time, and the two inputs are sent into two parallel processing branches respectively, and the features of the corresponding polarized image are extracted independently in each branch. In the embodiment, the parallel polarized features are the parallel glare features and the parallel non-glare features, and the cross polarized features include the cross glare features and the cross non-glare features. The parallel polarized features are the extraction and representation of the polarized characteristic information in the parallel polarized image, which reflects the optical behavior characteristics of the target substrate surface under the illumination of the parallel polarized light, such as reflection and scattering. The cross polarized features are also the extraction of the polarized characteristic information in the cross polarized image, which embodies the optical characteristics of the target substrate surface under the illumination of the cross polarized light, and is complementary to the parallel polarized features. The cross glare features are the features related to the glare (the strong and interfering reflected light region under the illumination of the parallel polarized light, which also has a certain embodiment in the cross polarized image) in the cross polarized image, which are the information reflecting the glare region under the cross polarized view extracted from the cross polarized image before the weight adjustment of the cross polarized features based on the parallel glare mask. The cross non-glare features are the features reflecting the real characteristics (such as edges, internal structures, defects, etc.) of the target substrate in the cross polarized image except the cross glare features, which are the feature parts reserved or highlighted after the weight adjustment of the cross polarized features based on the parallel glare mask. The brightness features and the reflection intensity features in the parallel polarized image are extracted by the preset dual-channel neural network to determine the parallel glare features and the parallel non-glare features, and the texture features and the edge features in the cross polarized image are extracted by the preset dual-channel neural network to determine the cross glare features and the cross non-glare features. Specifically, first, a parallel and cross polarized image dataset is collected, including different scenes and lighting conditions, and the images are labeled to define the glare and non-glare regions. A dual-channel network structure is designed, each channel processes different types of polarized images, including a parallel channel and a cross channel. The parallel channel is used to input the parallel polarized image to extract the brightness features and the reflection intensity features, and the cross channel is used to input the cross polarized image to extract the texture features and the edge features. Next, the convolution layer is used to extract the features, and the features of the two channels can be connected or fused at a certain layer to combine the feature information from the parallel and cross polarized images. The extracted features are input into the fully connected layer for final classification, and the classification results such as the probabilities of the glare and non-glare features are output through the activation function. Then, a suitable loss function (such as cross-entropy loss) is selected, and an optimization algorithm is used for training to obtain the preset dual-channel neural network, that is, the trained dual-channel neural network, which is used to determine the parallel glare features and the parallel non-glare features.The parallel glare feature refers to a feature formed by an over-bright area in the parallel polarization image due to the strong specular reflection of the surface of the target substrate at a specific angle to the parallel polarized light. In the parallel polarization image, the pixel brightness value of the over-bright area (parallel glare feature area) is significantly higher than that of the surrounding non-glare area. For example, assuming that the image brightness value range is 0-255 (common gray image brightness range), the brightness value of the over-bright area may be greater than Tb (Tb is a threshold value obtained by statistical analysis of a large number of normal non-glare images, such as Tb = 200, i.e., the area with a brightness value greater than 200 may belong to the over-bright parallel glare feature area). The parallel non-glare feature is a feature that does not exhibit the characteristics of the area affected by strong specular reflection. The cross glare feature is a feature formed by a small amount of light that can pass through the polarizer in some special cases in the cross polarization image. The cross non-glare feature refers to a feature of a relatively dark area formed by most of the light being blocked and unable to pass through the polarizer in the cross polarization image. In the cross polarization image, the brightness of the relatively dark area (cross non-glare feature area) is significantly lower than that of the surrounding areas that may have glare or other high brightness areas. Because most of the light is blocked by the polarizer, only a small amount of light passes through, resulting in low image brightness. For example, in the image gray value representation (assuming the gray value range is 0-255), the gray value of the dark area may be concentrated between 0-80, while the gray value of the glare or other high brightness area (such as the abnormal reflection area under cross polarization) may be greater than 120. The parallel glare mask in this embodiment is a binary mask for marking the glare area represented by the parallel polarization image, which is used to mark which pixel area in the parallel polarization image belongs to glare. The determination method of the parallel glare mask first uses the parallel polarization image branch in the dual-channel neural network to perform initial feature extraction on the parallel polarization image. Then, after passing through several network layers (such as further down-sampling the feature mapping through the pooling layer to highlight the main features) and more convolution layers, the neural network learns to represent the unique features of glare. Finally, a binary processing layer such as a Sigmoid function is used to map the feature values to the 0-1 interval, and then a threshold of 0.5 is set. The pixel positions greater than 0.5 are marked as 1, i.e., the glare area, and the pixel positions less than or equal to 0.5 are marked as 0, i.e., the non-glare area, to generate the parallel glare mask. In the mask, the glare area is marked as 1 and the non-glare area is marked as 0. The generation of the parallel glare mask mainly depends on the parallel polarization features extracted from the parallel polarization image. Because the parallel polarization image is most sensitive to glare, the features it contains best represent the existence and position of glare.
[0027] The adjusted cross-polar feature is obtained by adjusting the feature weight of the cross-polar feature based on the parallel glare mask. The parallel glare mask can provide information about the glare region, which can be used as a reference to adjust the weight of the cross-polar feature. The cross-polar feature before adjustment has a feature state containing glare interference, and the feature value in the glare region is greatly disturbed. The adjusted cross-polar feature has a feature state of reducing glare interference, the feature weight in the glare region is reduced, and the feature value in the glare region is suppressed (close to the true non-glare feature level). In the cross-polar image, although most of the light is blocked, some features still appear. These features may have different importance and forms in the glare region and the non-glare region. By using the parallel glare mask, it can be identified which regions in the cross-polar image may be affected by glare, so that the cross-polar feature of these regions can be adjusted in weight. For each pixel or region in the cross-polar feature, its weight is adjusted according to the information of the parallel glare mask. If the parallel glare mask marks a position as a glare region, the weight of the cross-polar feature at that position may be reduced; otherwise, if it is marked as a non-glare region, the weight may be increased.
[0028] The fusion feature map is obtained by combining the adjusted cross-polar feature and the parallel polar feature. The parallel polar feature includes the parallel glare feature and the parallel non-glare feature. The parallel glare feature reflects the specular reflection characteristics of the object surface under parallel polarized light, while the parallel non-glare feature reflects the diffuse reflection and other characteristics of the object surface. The adjusted cross-polar feature is obtained by adjusting the feature weight of the cross-polar feature based on the parallel glare mask. The weight of the adjusted cross-polar feature in the glare region may be reduced, while the weight in the non-glare region may be retained or increased. The adjusted cross-polar feature and the parallel polar feature are fused. The parallel polar feature may contain the detail and texture information of the object surface, while the adjusted cross-polar feature may more accurately reflect the shape and structure information of the object. By fusing the two, a fusion feature map containing both detail and texture and shape and structure can be obtained. The fusion feature can be fused by weighted fusion, which gives different weights to the cross-polar feature and the parallel polar feature, that is, for each pixel or region, the adjusted cross-polar feature and the parallel polar feature can be weighted and summed, and the weight can be determined according to the importance of the feature or the specific application requirements.
[0029] The fused feature map is input into a preset semantic segmentation network model to obtain an edge probability map of the target substrate. The preset semantic segmentation network model is a model architecture based on deep learning, and is a model designed in advance for performing a semantic segmentation task. The fused feature map is the input of the semantic segmentation network model, and is obtained after processing, feature extraction, weight adjustment, and fusion of the parallel polarized image and the cross-polarized image. The fused feature map contains rich information about the target substrate, which is the basis for the semantic segmentation network model to make edge probability predictions. The semantic segmentation network model first encodes the input fused feature map. The encoding process usually includes multiple convolutional layers and pooling layers. For example, the first layer of convolution extracts features from the fused feature map, extracting more abstract features such as integrated substrate features that fuse parallel polarization and adjusted cross-polarization information, which may include preliminary features of the edge, features of different material regions, etc. Then, through the pooling layer, down-sampling is performed to reduce the size of the feature map while increasing the number of channels to capture semantic information at different levels. After multiple layers of encoding, the network can extract deep-level semantic features about the substrate from the fused feature map, such as distinguishing the substrate from the background and different parts of the substrate. In the decoding stage, up-sampling is performed through transposed convolution (deconvolution) to gradually restore the size of the feature map to close to the input size. At the same time, in the decoding process, the feature maps at the corresponding levels in the encoding stage are fused with the decoding feature maps through skip connections. For example, when decoding at a certain layer, the feature map before the last down-sampling in the encoding stage (which contains rich detail information such as subtle pixel changes of the substrate edge) is spliced with the feature map of the current decoding layer (which contains high-level semantics such as the semantics of determining the substrate edge region), and then through convolution operation, the network can integrate the detail and semantic information. After multiple layers of decoding, a feature map with a size close to that of the input fused feature map is obtained. The edge probability map is a two-dimensional image with the same size as the input image, where the value of each pixel represents the probability that the pixel belongs to the edge of the target substrate. The pixel value usually ranges from 0 to 1, and the closer the value is to 1, the greater the likelihood that the pixel is the edge of the target substrate, and the closer the value is to 0, the smaller the likelihood. When the fused feature map is input into the semantic segmentation network model, the model processes and analyzes the feature map through its internal convolutional layers, pooling layers, up-sampling layers, etc., and uses the feature patterns learned about the edge of the target substrate in the training process to classify each pixel in the fused feature map. For each pixel, the model outputs a probability value representing the likelihood that the pixel belongs to the edge of the target substrate, and these probability values form a two-dimensional edge probability map.
[0030] According to the edge probability map, the edge position of the target substrate is determined by using a contour connection algorithm. The contour connection algorithm is an algorithm for identifying and connecting edge pixels in an image to form a complete contour. By analyzing the pixel values in the edge probability map, the pixels belonging to the edge of the target substrate are found, and these pixels are connected into continuous contour lines. The contour connection algorithm can be a Canny edge detection algorithm or the like. The edge probability map is a two-dimensional matrix, in which each pixel point has a probability value between 0 and 1. The probability value represents the possibility of the corresponding pixel point belonging to the edge of the target substrate. The closer the probability value is to 1, the higher the probability that the pixel point is an edge; the closer it is to 0, the lower the probability that it is an edge. The contour connection algorithm determines the edge position by first performing threshold segmentation on the edge probability map. A threshold value can be determined based on experience or statistical analysis of a large number of samples, such as threshold = 0.5. The edge probability map is converted into a binary image B(i,j). When the probability value is greater than or equal to the threshold value, the binary image = 1, indicating that the pixel point is considered an edge point; when the probability value is less than the threshold value, the binary image = 0, indicating that the pixel point is not considered an edge point. For example, after thresholding, the pixel points in the edge probability map with a probability value greater than or equal to 0.5 become white, and the rest become black, and a binary image containing discrete edge points is obtained. Next, the neighborhood range of the pixel point is determined, which is commonly four neighborhoods (four adjacent pixels above, below, left, and right) or eight neighborhoods (four neighborhoods + four diagonally adjacent pixels). Starting from a binary image = 1 pixel point (starting edge point), the neighborhood pixels are checked. If there is a binary image = 1 in the neighborhood pixels, it is considered that the two pixel points belong to the same edge contour, and they are connected. The neighborhood pixels are traversed in a certain order (such as clockwise or counterclockwise direction), and the connection is continuously extended to obtain the edge position. In this embodiment, the contour connection algorithm is used to process the edge probability map to determine the edge position of the target substrate. The algorithm scans the edge probability map to identify pixels with a probability value higher than a certain threshold, which are considered as candidate points of the edge of the target substrate. Subsequently, the algorithm connects these candidate points according to certain rules to determine the edge position of the target substrate.
[0031] By the characteristics of parallel and cross polarized cameras, the parallel polarized image is susceptible to glare from surface reflection, while the cross polarized image can suppress part of the glare but may lose details. By generating a parallel glare mask, the glare area in the parallel image can be accurately identified and the weight of the cross feature can be adjusted, which can effectively fuse the advantages of the two polarized images, significantly reduce glare interference, and improve the reliability of image processing. By using a dual-channel neural network to extract parallel and cross polarized features, the parallel feature retains more surface texture details, and the cross feature highlights material differences. Through feature fusion, the complementary information of the two features is integrated to avoid the feature failure problem caused by surface reflection, texture blur or light changes in a single polarization mode, and to improve the adaptability to complex surfaces. The fused feature map is input into a semantic segmentation network, which can output the probability of each pixel belonging to the edge, and can more accurately capture the fine edges and complex contours of the printed paperboard. Combined with a contour connection algorithm, discrete high-probability edge points can be connected into continuous closed contours to achieve more accurate positioning, reduce mechanical adjustment errors, and thus improve production efficiency.
[0032] In one of the embodiments of the present embodiment, the parallel polarized feature and the cross polarized feature are determined by using a preset dual-channel neural network in combination with the parallel polarized image and the cross polarized image, and the parallel glare mask is determined based on the parallel polarized feature, including the following steps: S210, extracting the brightness feature and the reflection intensity feature of the parallel polarized image by using the first branch channel of the preset dual-channel neural network; S220, calculating the brightness mean value and the brightness standard deviation and the reflection intensity mean value and the reflection intensity standard deviation based on the brightness feature and the reflection intensity feature, respectively; S230, setting the brightness threshold value in combination with the brightness mean value and the brightness standard deviation, and setting the reflection intensity threshold value in combination with the reflection mean value and the reflection standard deviation; S240, regarding the area in the parallel polarized image where the brightness feature exceeds the brightness threshold value and the reflection intensity feature exceeds the reflection intensity threshold value as the parallel glare area; S250, determining the parallel glare mask according to the parallel glare area; S260, extracting the cross glare feature and the cross non-glare feature of the cross polarized image by using the second branch channel of the preset dual-channel neural network; In the present embodiment, the parallel polarization features include parallel glare features and parallel non-glare features, and the cross polarization features include cross glare features and cross non-glare features. The parallel glare feature refers to a feature formed by an over-bright area in the parallel polarization image due to strong specular reflection of the surface of the target substrate to the parallel polarized light at a certain angle. The parallel non-glare feature refers to a feature exhibited by a region not affected by the strong specular reflection. The cross glare feature refers to a feature formed by a small amount of light passing through the polarizer in some special cases in the cross polarization image. The cross non-glare feature refers to a feature exhibited by a dark region formed by most of the light being blocked from passing through the polarizer in the cross polarization image.
[0033] The first branch channel of the preset double-channel neural network is used to extract the brightness feature and the reflection intensity feature of the parallel polarization image. In the present embodiment, the first branch channel is responsible for processing the parallel polarization image and is part of the overall architecture of the neural network. The first branch channel has an independent calculation process but is associated with the second branch channel and the subsequent network layers to complete the task of the entire neural network. The brightness feature reflects the brightness variation of different regions in the image and is related to factors such as the surface material of the object and the lighting conditions. The reflection intensity feature describes the intensity of the reflected light of the object surface, and the reflection intensity is directly related to the reflection ability of the object surface to the parallel polarized light. Through a pre-designed double-branch neural network, the first branch is used to process the parallel polarization image. The network layers of the first branch are used to analyze the input parallel polarization image, and finally the brightness feature and the reflection intensity feature are extracted. Specifically, the first branch channel can include multiple convolution layers. Taking the convolution layer as an example, each convolution layer scans the parallel polarization image through different convolution kernels. For brightness feature extraction, the convolution kernel can be sensitive to the gradual change of brightness in the image. The brightness variation pattern is extracted as part of the brightness feature through convolution operation. For reflection intensity feature extraction, another convolution kernel can be sensitive to the matching degree of the pixel value in the image to the parallel polarization light reflection model. The reflection intensity feature is extracted through learning and calculation, and then the feature representation of the brightness feature and the reflection intensity feature is determined through the first branch channel.
[0034] The brightness mean value is the average of brightness values of all pixels in the image, and can reflect the overall brightness level of the image. The brightness standard deviation measures the dispersion degree of brightness values in the image, i.e., the severity of brightness change. The reflection intensity mean value is the average of reflection intensity values of all pixels in the image, and can roughly reflect the average reflection characteristics of the object surface. The reflection intensity standard deviation represents the dispersion degree of reflection intensity values, and a large standard deviation indicates that the object surface has large differences in reflection characteristics, which may exist in regions of different materials or different states. The reflection intensity standard deviation can be calculated by using the square root of the average of squares of deviations of reflection intensity values of all pixels from the reflection intensity mean value. The brightness standard deviation can be calculated by using the square root of the average of squares of deviations of brightness values of all pixels from the brightness mean value.
[0035] The brightness threshold value can be set in combination with the brightness mean value and the brightness standard deviation, and the reflection intensity threshold value can be set in combination with the reflection mean value and the reflection standard deviation. The brightness mean value plus or minus a preset multiple of the standard deviation can be used, for example, the brightness mean value is μ, and the brightness standard deviation is σ. The brightness threshold value can be set as μ+kσ (k is a constant, usually 1 or 2), which can filter out pixels that are significantly higher than the average brightness. Or set as μ-kσ, which can filter out pixels that are significantly lower than the average brightness. The value of k can be set according to the actual application scenario and requirements. Similarly, the reflection intensity threshold value can be set according to the reflection intensity mean value and the standard deviation. For example, the mean value plus or minus a multiple of the standard deviation is used to determine the upper and lower threshold values of the reflection intensity. The reflection intensity mean value is μr, and the reflection standard deviation is σr. The reflection intensity threshold value can be set as μr+kσr (for filtering regions with reflection intensity significantly higher than the mean value) or μr-kσr (for filtering regions with reflection intensity significantly lower than the mean value). The value of k can be set according to the actual application scenario and requirements.
[0036] The region in the parallel polarization image where the luminance feature exceeds the luminance threshold and the reflection intensity feature exceeds the reflection intensity threshold is taken as a parallel glare region. In this embodiment, the luminance threshold is a critical value set according to a rule for dividing the high and low degrees of luminance in the image. For example, the luminance threshold T = μ + kσ (k is a constant), and the region higher than T is considered to be relatively bright. The reflection intensity threshold is a critical value set in combination with the mean and standard deviation of the reflection intensity for measuring the high and low degrees of the reflection intensity of the object surface. For example, the reflection intensity threshold TR = μ r + kσ r, and the region higher than the threshold indicates that the reflection intensity is relatively high. When a region in the parallel polarization image simultaneously satisfies the conditions of “the luminance feature exceeding the luminance threshold” and “the reflection intensity feature exceeding the reflection intensity threshold”, the region is determined to be a parallel glare region. Glare is caused by the strong reflection of parallel polarized light, which makes the region appear to be relatively high in luminance in the image, and because it is the strong reflection of a specific polarized light, the reflection intensity is also relatively high.
[0037] A parallel glare mask is determined according to the parallel glare region. The parallel glare region is a region identified in the parallel polarization image by the luminance feature exceeding the luminance threshold and the reflection intensity feature exceeding the reflection intensity threshold. The parallel glare mask is a mask specially generated for the parallel glare region, and the function is to “mark” the parallel glare region in the parallel polarization image from other regions. In the parallel glare mask, the pixel position value corresponding to the parallel glare region is set to 1, and the pixel position value corresponding to the non-parallel glare region is set to 0. For example, assuming that the original parallel polarization image is M x N in size, the parallel glare mask is also an M x N matrix, wherein the pixels in the previously determined parallel glare region are 1 in the corresponding position of the mask matrix, and the rest are 0. Each pixel of the parallel polarization image is traversed, and the value of the corresponding pixel in the parallel glare mask is set according to whether the pixel belongs to the parallel glare region. If it is a glare region pixel, the mask value is set to 1; otherwise, it is set to 0.
[0038] The cross glare feature and the cross non-glare feature of the cross polarization image are extracted by using a second branch channel of the preset double-channel neural network. In this embodiment, the second branch channel is a channel specially responsible for processing the cross polarization image, which is associated with the first branch channel and the subsequent network layers to jointly complete the task of the entire neural network. The cross glare feature refers to the features of the glare region in the cross polarization image, which can include the pixel value distribution, texture features, edge characteristics, and other characteristics of the region. Through the neural network layer of the second branch channel, these glare-related features can be extracted from the cross polarization image. The cross non-glare feature is the feature of the region other than the glare region in the cross polarization image, which describes the characteristics of the normal part of the object, such as the features of the main structure of the object, the background environment, and the like. Similarly, through the neural network processing of the second branch channel, these features are extracted.
[0039] In the present embodiment, the luminance feature and the reflection intensity feature of the parallel glare feature in the parallel polarized image are maximum features under preset conditions, which means that the texture feature and the edge feature of the cross glare feature in the cross polarized image are maximum features under preset conditions. Specifically, an LED area light source with a linear polarized film is arranged above the work station, at the camera end, a beam splitter is used to divide the light path into two, and the two are introduced into two synchronously triggered cameras respectively. A linear polarized film is arranged in front of each camera, and the polarization directions of the two are perpendicular to each other (orthogonal). That is, when the above conditions are met, in the cross polarized image, the texture feature of the cross glare region is the most obvious, and the edge feature of the cross glare region is also the most obvious. In the parallel polarized image, the luminance of the parallel glare region is usually the highest, and the reflection intensity of the parallel glare region is the largest.
[0040] By determining the parallel polarized feature and the cross polarized feature, and determining the parallel glare mask based on the parallel polarized feature, the parallel glare region can be more accurately identified, which helps to exclude the interference of glare on the detection result in the defect detection task, and improves the accuracy of defect detection.
[0041] In one of the embodiments of the present embodiment, the steps for extracting the cross glare feature and the cross non-glare feature of the cross polarized image by using the second branch channel of the preset double-channel neural network include the following steps: S310, extracting the texture feature and the edge feature of the cross polarized image by using the second branch channel of the preset double-channel neural network; S320, determining the edge gradient amplitude and the edge pixel connection degree according to the edge feature; S330, when the edge gradient amplitude is greater than or equal to the preset edge gradient threshold and the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold, the cross non-glare feature is determined; S340, when the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is less than the preset edge connection degree threshold, the cross glare feature is determined; S350, when the edge gradient amplitude is greater than or equal to the preset edge gradient threshold and the edge pixel connection degree is less than the preset edge connection degree threshold, the texture complexity is calculated according to the texture feature; S360, when the texture complexity does not exceed the preset texture feature threshold, the cross glare feature is determined; S370, when the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold, the edge gray mean is calculated according to the edge feature; S380, when the edge gray mean exceeds the preset gray threshold, the cross glare feature is determined.
[0042] The second branch channel of the preset double-channel neural network is used to extract the texture feature and the edge feature of the cross-polarization image. In this embodiment, the second branch channel is a channel specially set for processing the cross-polarization image, and is associated with the first branch channel and the subsequent network layers to jointly complete the task of the entire neural network. The texture feature of the cross-polarization image describes the texture information of different regions in the image, such as roughness, smoothness, regular pattern or irregular pattern, etc. Through the operation of the neural network layer of the second branch channel, the texture feature can be extracted from the cross-polarization image. The edge feature of the cross-polarization image describes the contour of the object in the image and the boundary between different regions. Through the processing of the neural network, the second branch channel can extract the edge feature in the cross-polarization image.
[0043] Subsequently, the edge gradient amplitude and the edge pixel connectivity are determined according to the edge feature. The edge gradient amplitude represents the rate of change of image brightness at the edge. The greater the gradient amplitude, the more intense the brightness change at the edge, and the more obvious the edge. The edge gradient amplitude can be determined by calculating the gradient of each pixel point in the image. The gradient can be calculated using a gradient operator such as the Sobel operator. The edge gradient amplitude can help to distinguish between strong edges and weak edges. Strong edges correspond to important boundaries or contours in the image. The edge pixel connectivity reflects the degree to which the edge forms a coherent contour in the image, and can be determined by analyzing the spatial relationship between edge pixels. For example, morphological operations, connected region analysis or contour tracking algorithms can be used to identify and quantify the connection of edge pixels. The edge pixel connectivity helps to identify complete edge contours and shapes. Edge pixels with high connectivity are more likely to belong to the boundaries or contours of the same object.
[0044] When the edge gradient amplitude is greater than or equal to the preset edge gradient threshold value and the edge pixel connectivity is greater than or equal to the preset edge connectivity threshold value, the cross-non-glare feature is determined. The preset edge gradient threshold value is a pre-set reference value for distinguishing the strength of the edge; the preset edge connectivity threshold value is a pre-set reference value for judging whether the edge pixels have sufficient continuity and connectivity, which can be determined according to experience or data statistics. That is, when the edge gradient amplitude is greater than or equal to the preset edge gradient threshold value, and the edge pixel connectivity is greater than or equal to the preset edge connectivity threshold value, it is considered that the edge feature of the region meets the requirements of the cross-non-glare feature, and the region that meets the above conditions is determined as the cross-non-glare feature region.
[0045] When the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connectivity is less than the preset edge connectivity threshold, the cross-glare feature is determined, that is, when a certain region in the cross-polarization image simultaneously satisfies the two conditions of "the edge gradient amplitude is less than the preset edge gradient threshold" and "the edge pixel connectivity is less than the preset edge connectivity threshold", it is determined that the region has the cross-glare feature. The formation of the glare region is often not due to the obvious gray difference between the object and the background, but due to the scattering, reflection and other complex phenomena of light, which may cause the gray change of the edge of the glare region to be relatively flat, and the edge gradient amplitude of the glare region is less than the gradient amplitude of the normal object edge (i.e. less than the preset threshold). The edge of the glare region is usually irregular and discontinuous. It may be due to the irregular shape of defects such as oil stains and scratches, so that the edge pixels of the glare region in the cross-polarization image cannot be continuously connected like the edge of the normal object, thereby causing the edge pixel connectivity to be less than the preset threshold.
[0046] When the edge gradient amplitude is greater than or equal to the preset edge gradient threshold and the edge pixel connectivity is less than the preset edge connectivity threshold, the texture complexity is calculated according to the texture feature, that is, when a certain region in the image simultaneously satisfies the two conditions of "the edge gradient amplitude is greater than or equal to the preset edge gradient threshold" (which indicates that the region has a certain degree of gray change, which may be an object edge or other regions with gray change) and "the edge pixel connectivity is less than the preset edge connectivity threshold" (which indicates that the edge of the region is discontinuous and not tight), the subsequent texture complexity calculation operation is triggered. The texture feature describes the texture information of different regions in the image, such as rough, smooth, regular pattern or irregular pattern, etc. The texture complexity calculated according to the texture feature is a quantitative description of the texture feature of the image, which is used to measure the complexity of the texture, and can be realized based on the gray level co-occurrence matrix. The gray level co-occurrence matrix describes the co-occurrence relationship of pixel gray values in a certain direction and distance in the image. The texture complexity can be measured by calculating some statistics (such as entropy, contrast, energy, correlation, etc.) of the gray level co-occurrence matrix.
[0047] When the texture complexity does not exceed the preset texture feature threshold, the cross-glare feature is determined, and the preset texture feature threshold is a critical value set in advance to judge the high and low of the texture complexity. If the surrounding texture complexity (such as the entropy based on the gray level co-occurrence matrix) is lower than the texture feature threshold, it is judged as the cross-glare feature (which may be a high gradient amplitude but discontinuous edge of the glare region due to some reasons, such as an edge caused by local strong reflection, but the overall texture is single); otherwise, it is judged as a suspected special edge (such as a damaged edge on a paperboard, which can be further confirmed by more context information or other features).
[0048] When the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold, the edge gray mean value is calculated according to the edge feature, that is, when a certain region in the image meets the two conditions of "the edge gradient amplitude is less than the preset edge gradient threshold" (which indicates that the gray change of the region is relatively flat, and it is not likely to be the clear boundary of the object) and "the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold" (which indicates that the edge of the region has a certain continuity), the subsequent edge gray mean value calculation operation is triggered. The edge gray mean value is calculated according to the edge feature, which can extract the edge feature (assuming it is in the form of a gray image, the edge pixels have corresponding gray values) and then calculate the gray mean value of the edge pixels.
[0049] When the edge gray mean value exceeds the preset gray threshold, the cross-glare feature is determined, and in the embodiment, the preset gray threshold can be determined according to the actual situation. After obtaining the gray mean value, if the gray mean value is higher than the gray mean value threshold, it is judged as a cross-glare feature (a continuous edge with high gray mean value and low gradient amplitude, which may be a large-area continuous reflection edge of the glare region). Otherwise, it is judged as a non-glare region feature (such as a low-contrast but continuous paperboard internal texture edge, which can be further confirmed in combination with other features such as texture direction).
[0050] By determining the cross-glare feature and the cross-non-glare feature of the cross-polarization image, the cross-glare feature and the cross-non-glare feature can be accurately distinguished, the misjudgment and omission are reduced, the accuracy of defect detection is improved, and the effect of quality control is improved.
[0051] In one of the embodiments of the present embodiment, the adjusted cross-polarization feature is obtained by adjusting the feature weight of the cross-polarization feature based on the parallel glare mask, including the following steps: S410, the parallel glare mask is matched with the cross-polarization feature in space position to determine the spatial correspondence between each parallel glare mask and the cross-polarization feature; S420, the pixel value of the parallel glare mask corresponding to the cross-polarization feature is determined according to the spatial correspondence; S430, the cross-polarization feature value is determined based on the cross-polarization feature; S440, the adjustment weight is calculated according to the pixel value of the parallel glare mask and the preset weight factor; S450, the product of the adjustment weight and the cross-polarization feature value is calculated to obtain the adjusted cross-polarization feature.
[0052] The spatial position matching of the parallel glare mask and the cross-polarization feature determines the spatial correspondence between each parallel glare mask and the cross-polarization feature. The parallel glare mask is a binary matrix with the same size as the parallel polarization image, in which the glare area and the non-glare area in the parallel polarization image are marked. In the spatial position matching process, the parallel glare mask and the cross-polarization feature map are aligned so that they are in the same spatial coordinate system. Through spatial position matching, the corresponding position of the glare area marked in the parallel glare mask in the cross-polarization feature map is determined, which helps to understand the feature performance of the glare area in the cross-polarization image.
[0053] According to the spatial correspondence, the pixel value of the parallel glare mask corresponding to the cross-polarization feature is determined. After spatial position matching, each pixel or feature point of the parallel glare mask and the cross-polarization feature map is one-to-one corresponding in spatial position. That is, each pixel in the cross-polarization feature map can find its corresponding position in the parallel glare mask. For each pixel or feature point in the cross-polarization feature map, the pixel value at the corresponding position in the parallel glare mask is obtained according to the corresponding position. This pixel value can be 0 or 1, where 1 indicates that the position is a glare area in the parallel polarization image, and 0 indicates a non-glare area.
[0054] Based on the cross-polarization feature, the cross-polarization feature value is determined. The cross-polarization feature includes texture features and edge features, that is, the cross-polarization feature value is determined according to the texture features and the edge features. The texture features can be determined by a gray-scale resonance matrix, and an edge detection algorithm can be applied to identify the edges in the image and extract the edge features. The texture features include texture statistics such as contrast and entropy, and the edge features include edge gradient amplitude mean and edge pixel connectivity; the edge features and the texture features can be quantized, the extracted texture features and edge features can be combined into a feature vector, and the statistical values (such as mean and standard deviation) of each feature can be calculated as the final cross-polarization feature value according to specific requirements.
[0055] The adjustment weight is calculated according to the pixel value of the parallel glare mask and the preset weight factor, that is, the adjusted cross-polarization feature value is equal to the original cross-polarization feature value multiplied by a dynamic weight factor, and the weight factor is determined by the parallel glare mask value and the weight parameter. The specific form of the adjustment weight is as follows:
[0056] where M represents the adjustment weight, m(i,j) represents the binary identification of the parallel glare mask at the (i,j) position (taking values of 0 or 1), which is used to mark whether the pixel is affected by the parallel glare (1 represents affected, 0 represents not affected); is a preset weight factor (0 < a < 1), used to control the intensity of the feature value adjustment, the greater the value, the greater the adjustment range, which can be determined according to actual conditions.
[0057] The retention ratio of the original feature value is dynamically adjusted by the product of the mask value m(i, j) and the weight factor .
[0058] Subsequently, the product of the adjustment weight and the cross-polarization feature value is calculated to obtain the adjusted cross-polarization feature. That is, the adjusted cross-polarization feature value is obtained by multiplying the cross-polarization feature value by the adjustment weight. For pixels in the glare area, their cross-polarization feature values are multiplied by a smaller weight factor, thereby reducing their influence in subsequent analysis. For pixels in the non-glare area, their cross-polarization feature values are multiplied by 1.0, keeping their original values unchanged. The specific form of the adjusted cross-polarization feature is as follows:
[0059] wherein, represents the adjusted cross-polarization feature; represents the cross-polarization feature value; represents the parallel glare mask; is a preset weight factor, The value of a can be determined based on statistical analysis. A large number of cross-polarization image samples containing glare areas are collected, and the feature value distribution of the glare area in the cross-polarization image (assuming that the cross-polarization feature value can be represented by a certain statistical quantity, such as the average feature value μ g , the feature value variance σ g 2 ) and the feature value distribution of the normal non-glare area (especially the edge area) (the average feature value μ ng , the feature value variance σ ng 2 ) are analyzed. An optimization goal can be defined according to actual requirements, for example, to make the adjusted feature value distribution of the glare area (a x μ g and the adjusted variance) as close as possible to the feature value distribution of the normal non-glare area, while ensuring that the adjusted feature value is not excessively distorted. The optimal value of a is solved by mathematical calculation (such as minimizing |a x μ g - μ ng | + |a 2 x σ g 2 - σ ng 2 |).
[0060] When the pixel is affected by glare (a When the pixel is not affected by glare (i.e., F(i,j)=0), the weight is calculated as 1-0x(1-a)=1, i.e., the adjusted feature value remains F(i,j)x1=F(i,j). This means that for pixels not contaminated by glare, their feature values are completely preserved (weight is 1), avoiding the loss of valid information.
[0061] When the pixel is not affected by glare (i.e., F(i,j)=0), the weight is calculated as 1-0x(1-a)=1, i.e., the adjusted feature value remains F(i,j)x1=F(i,j). This means that for pixels not contaminated by glare, their feature values are completely preserved (weight is 1), avoiding the loss of valid information.
[0062] By combining the parallel glare mask and the cross-polarized feature, the information in different polarized images is fully utilized, providing more comprehensive feature support for subsequent image analysis. The adjusted cross-polarized feature integrates multi-dimensional information such as spatial position, feature value and weight, and can more comprehensively describe the objects and scenes in the image.
[0063] In one embodiment of the present embodiment, the feature fusion of the adjusted cross-polarized feature and the parallel polarized feature to obtain the fused feature map includes the following steps: S510, constructing a first feature hierarchical structure and a second feature hierarchical structure from the adjusted cross-polarized feature and the parallel polarized feature, respectively; S520, calculating the weight value of each feature in the first feature hierarchical structure and the weight value of each feature in the second feature hierarchical structure; S530, constructing a total weight map combining the weight values in the first feature hierarchical structure and the weight values in the second feature hierarchical structure; S540, based on the total weight map, the first feature hierarchical structure and the second feature hierarchical structure, splicing the features of the same level according to the corresponding level to obtain the fused features; S550, constructing a Laplacian pyramid according to the fused features to obtain the fused feature map.
[0064] The adjusted cross-polarized feature and the parallel polarized feature are respectively constructed into a first feature hierarchical structure and a second feature hierarchical structure. The first feature hierarchical structure contains adjusted cross-polarized features of different levels from fine to coarse. The low layer provides fine details of the image, suitable for detecting small-scale features; the high layer provides large-scale structural information; the second feature hierarchical structure organizes the parallel polarized features in the same way, providing representations of the parallel polarized features at different scales, which helps to understand the structure and details of the image from different perspectives. Methods such as Gaussian pyramid and Laplacian pyramid can be used to downsample the feature map multiple times to generate a sequence of feature maps with different resolutions. Each layer of feature map represents the information of the original feature map at a certain scale.
[0065] The weight value of each feature in the first feature hierarchy and the weight value of each feature in the second feature hierarchy are calculated. In the embodiment, the weight value of each feature in the first feature hierarchy refers to the weight value of each feature of the adjusted cross-polarization feature, and the adjusted cross-polarization feature includes the texture feature and the edge feature. The weight value of each feature in the second feature hierarchy refers to the weight value of each feature of the parallel-polarization feature, and the parallel-polarization feature includes the brightness feature and the reflection intensity feature. Specifically, the weight value can be calculated according to the significance of the texture feature (such as the complexity, uniformity, etc. of the texture). The weight value is larger in the area with higher texture feature significance. Secondly, the weight value is calculated according to the significance of the edge feature (such as the gradient amplitude, connectivity, etc. of the edge). The weight value is larger in the area with higher edge feature significance. The parallel-polarization feature includes the brightness feature and the reflection intensity feature. For each feature (the brightness feature and the reflection intensity feature) in the second feature hierarchy, the weight value is calculated. The weight value is calculated according to the significance of the brightness feature (such as the contrast, uniformity, etc. of the brightness). The weight value is larger in the area with higher brightness feature significance. The weight value is calculated according to the significance of the reflection intensity feature (such as the contrast, uniformity, etc. of the reflection intensity). The weight value is larger in the area with higher reflection intensity feature significance. The weight value is determined by analyzing the significance of each feature in the image. The feature with higher significance is usually more important for the image analysis task, and thus the weight value is larger.
[0066] The overall weight map is constructed by combining the weight values in the first feature hierarchy and the weight values in the second feature hierarchy. After the weight values in the first feature hierarchy and the weight values in the second feature hierarchy, the weight values in each feature hierarchy are weighted and summed.
[0067]
[0068] wherein W 总体 is the overall weight map, W 纹理 , W 边缘 , W 亮度 and W 反射强度 are the weight values of the texture feature, the edge feature, the brightness feature and the reflection intensity feature respectively, β, γ and δ are weighting coefficients for adjusting the importance of each feature. In the embodiment β, γ and δ can be determined according to the actual situation. Among them, W 纹理 , W 边缘 , W 亮度 and W 反射强度The corresponding weight value can be calculated according to the corresponding saliency. The saliency is calculated based on machine learning. For example, a large amount of image data is labeled, and the edges and blurred internal texture edges with different saliencies in the image are marked. For edge features, a Canny operator or the like can be used to first extract an edge feature map. Next, a plurality of attributes of the edge features are extracted as feature vectors. For example, for each edge pixel, the edge intensity (such as the edge intensity value output by the Canny operator), the edge direction (obtained by gradient calculation), and the length of the edge segment where the edge pixel is located are calculated. The labeled training data (containing feature vectors of high-saliency and low-saliency edges) are used to train a random forest classifier. During the training process, the classifier learns the mapping relationship between different feature vectors and edge saliency. For a new image edge feature map, the feature vector of each edge pixel (or segment) is extracted, input into the trained random forest classifier, and the saliency probability of each edge is obtained. The weight value W of the edge feature is calculated as follows: 边缘 The saliency probability of the entire image edge feature can be averaged to achieve the weight value.
[0069] The features in the same level are spliced to obtain the fused features according to the corresponding level based on the overall weight map, the first feature hierarchical structure, and the second feature hierarchical structure. Each level in the feature hierarchical structure represents a feature of different scales. For example, the first layer can be a feature map of the original resolution, the second layer can be a down-sampled feature map, and so on. At each corresponding level, the feature maps in the first feature hierarchical structure and the second feature hierarchical structure are spliced. The splicing can be weighted fusion. Subsequently, in the splicing process, the overall weight map is used to adjust the weight of each feature. The feature with a higher weight value occupies a larger proportion in the fused feature map. The fusion strategy can include weighted summation. First, ensure that the first feature hierarchical structure and the second feature hierarchical structure are aligned in spatial position. The weight value in the overall weight map is obtained. For each level, the feature maps in the first feature hierarchical structure and the second feature hierarchical structure are extracted. According to the weight value in the overall weight map, the feature maps are weighted, and the weighted feature maps are spliced. The spliced feature map is taken as the fused feature.
[0070] According to the fused features, a Laplacian pyramid is constructed to obtain a fused feature map. First, the fused feature map is decomposed by a Gaussian pyramid to generate a series of images with different resolutions. Through downsampling and Gaussian filtering, the resolution of the image is gradually reduced to obtain a multi-level Gaussian pyramid. Starting from the highest resolution layer of the Gaussian pyramid, each Gaussian pyramid layer is compared with its downsampled version to calculate the difference. These differences are taken as each layer of the Laplacian pyramid, thereby obtaining a multi-layer pyramid containing different scale detail information. Each layer of the Laplacian pyramid is upsampled and combined layer by layer to finally obtain a fused feature map, which retains the details of the original image and combines different scale feature information.
[0071] By combining the adjusted cross-polarization features and parallel-polarization features for feature fusion to obtain a fused feature map, the image quality can be improved, noise interference can be reduced, the target and edge can be more accurately located, the detection accuracy can be improved, and the segmentation accuracy can be improved.
[0072] In one of the embodiments of the present embodiment, constructing a first feature hierarchical structure and a second feature hierarchical structure from the adjusted cross-polarization features and parallel-polarization features respectively includes the following steps: S610, local brightness change features and local reflection intensity features are extracted by combining the parallel-polarization features, and the local brightness change features and the local reflection intensity features are taken as first-level features; S620, second-level features are obtained by performing cluster analysis on the local brightness change features and the local reflection intensity features; S630, brightness global features and reflection global features are extracted as third-level features according to the parallel-polarization features; S640, a first feature hierarchical structure is constructed based on the first-level features, the second-level features, and the third-level features; S650, texture fine-grained features and edge fine-grained features are extracted by combining the adjusted cross-polarization features, and the texture fine-grained features and the edge fine-grained features are taken as fourth-level features; S660, texture local features and edge local contour features are obtained by performing cluster analysis on the texture fine-grained features and the edge fine-grained features, and the texture local features and the edge local contour features are taken as fifth-level features; S670, edge overall contour features and texture overall features are extracted as sixth-level features according to the adjusted cross-polarization features; S680, a second feature hierarchical structure is constructed by combining the fourth-level features, the fifth-level features, and the sixth-level features.
[0073] The local brightness change feature and the local reflection intensity feature are extracted in combination with the parallel polarization feature, and the local brightness change feature and the local reflection intensity feature are taken as first-level features. The local brightness change feature refers to the change of brightness in a local region in the image. The local reflection intensity change feature refers to the change of reflection intensity in a local region in the image. The first-level feature refers to a feature at the most basic level in a feature level structure. The local brightness change feature and the local reflection intensity feature can reflect the most basic visual information of the image. The local brightness change feature and the local reflection intensity feature can be extracted by using a Sobel operator or a convolution operation or a local statistical analysis method.
[0074] Second-level features are obtained by performing cluster analysis on the local brightness change feature and the local reflection intensity feature. Cluster analysis is to divide data objects into several subsets that are highly homogeneous internally and significantly heterogeneous externally, so that the difference within the cluster is minimized and the difference between the clusters is maximized by measuring the similarity or distance between samples. The first-level feature is a description of the local features of each small region in the image, for example, the brightness change of region A is fast, and the reflection intensity is high; the brightness change of region B is slow, and the reflection intensity is low. The similarity between different local regions is calculated. The closer the brightness change law and the reflection intensity characteristics of two regions are, the more similar they are, and they are clustered into second-level features. After clustering, the second-level feature is no longer a scattered feature of a single local region, but a whole description of the "cluster", which is a generalization of the first-level feature. In this embodiment, the features obtained after quantizing the local brightness change feature and the local reflection intensity feature through cluster analysis.
[0075] The brightness global feature and the reflection global feature are extracted as third-level features according to the parallel polarization feature. In this embodiment, the brightness global feature is the overall property of brightness from the perspective of the entire image or scene, which can include average brightness, brightness variance, shape of brightness histogram, and other statistical quantities. The reflection global feature is a general description of the reflection characteristics of the object surface, which can include average reflectivity, distribution range of reflectivity, reflection proportion relationship of different wavelengths of light, and the like. The third-level feature is the global brightness and global reflectivity statistics extracted from the parallel polarization image, which describes the brightness and reflection characteristics under parallel polarized light from a global perspective, is the highest level, most general and abstract feature, and can reflect the overall and macroscopic characteristics. The third-level feature can be extracted by using a pre-trained machine learning model.
[0076] The first feature hierarchical structure is constructed based on the first level feature, the second level feature and the third level feature. The first feature hierarchical structure is organized together with the first, second and third level features according to the hierarchical relationship of the features. A pyramid structure can be formed. The first level feature is at the bottom layer, has the largest quantity and is the basis; the second level feature is at the middle layer, is the preliminary integration and abstraction of the bottom layer feature; and the third level feature is at the top layer, is the most refined and most general feature. For example, the bottom layer stores each first level feature, such as the local brightness change value and the local reflection intensity value of each local region; the middle layer stores the clustered second level feature, such as each cluster category and the statistical information of the first level feature index or feature value contained by the cluster category; and the top layer stores the third level feature, such as the global brightness mean value, the global reflectivity and the like.
[0077] The texture fine-grained feature and the edge fine-grained feature are extracted in combination with the adjusted cross-polarization feature, and the texture fine-grained feature and the edge fine-grained feature are taken as the fourth level feature. In the embodiment, the texture fine-grained feature refers to the arrangement mode and the change rule of the texture feature in the local region; and the edge fine-grained feature refers to a feature set for describing the fine and microscopic characteristics of the edge in the object or the image based on the adjusted cross-polarization feature. In the embodiment, the fourth level feature refers to the texture fine-grained feature and the edge fine-grained feature extracted in combination with the adjusted cross-polarization feature. The texture fine-grained feature and the edge fine-grained feature can be extracted by using the local binary pattern and the edge detection algorithm, such as the Sobel operator and the like.
[0078] The texture local features and the edge local contour features are obtained by clustering analysis of the texture fine-grained features and the edge fine-grained features, and the texture local features and the edge local contour features are taken as the fifth level features. In the embodiment, the fifth level features refer to the features obtained by further integration based on the texture local features and the edge local contour features through clustering analysis on the fourth level features. The texture local features are more general features obtained by clustering analysis based on the texture fine-grained features, and are no longer the description of single micro texture details, but the comprehensive description of local regions with similar texture fine-grained features. The edge local contour features are general features about local edges obtained by clustering analysis based on the edge fine-grained features, and are no longer all the fine features of a specific edge, but the comprehensive description of local edge segments with similar edge fine-grained features. For the texture fine-grained features and the edge fine-grained features, the clustering algorithm is used to calculate the similarity of each texture fine-grained feature sample and the clustering centers and the similarity of each edge fine-grained feature and the clustering centers, and the samples are assigned to the cluster where the nearest clustering center is located. Then the clustering centers are updated, which can be the mean of the samples in the cluster, and the process is repeated until the clustering centers no longer change significantly. Subsequently, the texture fine-grained features are aggregated into K texture local features, and each texture local feature represents a class of local regions with similar texture fine-grained features.
[0079] The sixth level features are obtained according to the adjusted cross-polarization features, the edge overall contour features are the description of the macroscopic form and characteristics of the whole edge of the object, and are not the microscopic details of the edge, but the shape, direction, closure and the like of the edge as a whole; the texture overall features are the generalization of the global attributes and patterns of the surface texture of the object, and are not limited to the details of local texture or clustering of local texture. In the embodiment, the sixth level features are the macroscopic and global description features of the edge and the texture of the object. The edge overall contour features and the texture overall features can be extracted by using methods such as Canny operator and global features of gray level co-occurrence matrix.
[0080] The second feature hierarchical structure is constructed in combination with the fourth level features, the fifth level features and the sixth level features. The second feature hierarchical structure is organized together according to the hierarchical relationship of the features (fourth level→fifth level→sixth level), forming a pyramid-like hierarchical structure. The bottom layer is the fourth level features, which are the most numerous and are the foundation, containing a large amount of information about texture and edge micro details; the middle layer is the fifth level features, which are less numerous and are the clustering and integration of the bottom layer features, reflecting local patterns; and the top layer is the sixth level features, which are the least numerous and are a high-level summary of overall characteristics. The bottom layer stores various specific texture fine-grained feature values and edge fine-grained feature values; the middle layer stores clustered texture local features and edge local contour features; and the top layer stores edge overall contour feature values and texture overall feature values.
[0081] By constructing the first feature hierarchical structure and the second feature hierarchical structure, the detection capability of complex surfaces can be improved, the stability under complex lighting conditions can be enhanced, and thus the performance of the model in texture and edge related tasks (such as edge detection, texture classification, segmentation, etc.) can be improved.
[0082] In one of the embodiments of the present embodiment, determining the edge position of the target substrate according to the edge probability map using a contour connection algorithm includes the following steps: S710, converting the edge probability map into an edge binary map, wherein the pixel points in the edge binary map with a probability value greater than or equal to a preset threshold value are regarded as edge points, and the pixel points in the edge binary map with a probability value less than the preset threshold value are regarded as non-edge points; S720, traversing the edge binary map to determine discrete edge segments in the edge binary map using a contour detection algorithm; S730, calculating the length of each discrete edge segment, and regarding the discrete edge segment with a length exceeding a preset length threshold value as an effective discrete edge segment; S740, calculating the distance between each effective discrete edge segment, and connecting the effective discrete edge segments with a distance less than a preset distance threshold value to determine the initial edge position of the target substrate; S750, performing edge fitting on the initial edge position based on a preset contour shape of the target substrate to determine the edge position of the target substrate.
[0083] The edge probability map is converted into an edge binary map, where the pixel points in the edge binary map with a probability value greater than or equal to a preset threshold are edge points, and the pixel points in the edge binary map with a probability value less than the preset threshold are non-edge points. The edge probability map is a two-dimensional image with the same size as the input image, where the value of each pixel represents the probability that the pixel belongs to the target substrate edge. A threshold can be selected as a standard for distinguishing edge points and non-edge points, or it can be dynamically adjusted according to the specific characteristics of the image and the application scenario. Each pixel point in the edge probability map is checked one by one. If the probability value of the pixel point is greater than or equal to the preset threshold, the corresponding pixel point in the edge binary map is marked as an edge point. If the probability value of the pixel point is less than the preset threshold, the corresponding pixel point in the edge binary map is marked as a non-edge point.
[0084] Subsequently, discrete edge segments in the edge binary map are determined using a contour detection algorithm. In the edge binary map, edge points can form continuous edge lines or discontinuous edge segments. The contour detection algorithm is an algorithm for identifying the contours of objects in an image. It can identify edge points with connectivity in the image based on chain code and organize them into contour lines or edge segments. Each pixel point in the edge binary map is checked to determine whether it is an edge point. For each edge point, the surrounding pixels are checked to determine the connectivity between edge points. The contour detection algorithm is used to track the connected edge points to form an edge segment. Subsequently, the image is iterated to find other unvisited edge points, and the above process is repeated until all edge points are processed.
[0085] The length of each discrete edge segment is calculated, and the discrete edge segments with a length exceeding a preset length threshold are considered valid discrete edge segments. The preset length threshold can be determined based on actual conditions. After edge detection in the image, discontinuous and discrete edge pixel points are obtained. These discrete edge pixel points can be connected into line segments, which are discrete edge segments. The length of each discrete edge segment can be calculated based on pixel count or geometric distance. The length of each discrete edge segment is compared with the preset length threshold. If the length of a discrete edge segment exceeds the preset length threshold, it is marked as a valid discrete edge segment.
[0086] The distance between each pair of effective discrete edge segments is calculated, and the effective discrete edge segments with a distance less than a preset distance threshold are connected to determine the initial edge position of the target substrate. The preset distance threshold can be determined according to a specific application scenario and requirements. For each pair of effective discrete edge segments in the image, the distance between them is calculated. This distance can be the Euclidean distance between the closest two points of the edge segments. When the distance between two effective discrete edge segments is less than the preset distance threshold, it is considered that they belong to the same edge part and can be connected. By connecting the effective discrete edge segments with a close distance, one or more continuous edges are formed. In this embodiment, the initial edge position is the approximate position of the target substrate edge determined by the edge processing and analysis process.
[0087] An edge fitting is performed on the initial edge position based on a preset contour shape of the target substrate to determine the edge position of the target substrate. The preset contour shape is a contour shape set according to the expected shape of the target substrate (for example, a rectangle, a circle, etc.). The initial edge position is matched with the preset contour shape by using the least square method, Hough transform, etc., so that the model is as close as possible to the initial edge position. The fitting degrees of different preset contour shapes and the initial edge position are compared, and the contour with the highest fitting degree is selected as the edge position of the target substrate. According to the fitting result, the accurate edge position of the target substrate is obtained, which provides a high-precision basis for subsequent measurement, positioning, etc.
[0088] By determining the edge position of the target substrate, the accuracy of the determination of the edge position of the target substrate is effectively improved, and the efficiency and effect of subsequent processing are improved, which provides a solid foundation for subsequent target substrate recognition, measurement, positioning, etc.
[0089] In one of the embodiments of the present embodiment, the method further includes the following steps: S810, determining a target vertex according to a preset contour shape of the target substrate; S820, extracting a target vertex coordinate in combination with the edge position of the target substrate and the target vertex; S830, determining an edge position area and an edge position shape according to the target vertex coordinate and the edge position of the target substrate; S840, verifying the edge position of the target substrate in combination with the edge position area, the edge position shape, and the preset contour shape; S850, if the edge position area and the edge position shape pass the verification, determining the edge position of the target substrate.
[0090] The target vertex is determined according to the preset contour shape of the target substrate. The preset contour shape refers to the standard contour shape of the target substrate, such as a rectangle, a circle, a triangle, etc., which can be set according to design specifications or the like. The target vertex refers to the position of a key corner or endpoint of the target substrate in an image or space, and is a key feature point of the contour of the target substrate, used to position and describe the direction, shape, and position of the target substrate. By matching algorithms (such as template matching or geometric fitting), the preset contour shape is compared with the edges or other features in the image to identify the most matching target region. After determining the matching target region, the vertex position of the target region is calculated and extracted according to the geometric characteristics of the preset contour shape, for example, a rectangle can be extracted by four corner points; a circle can be determined by the center and radius; a triangle can be extracted by three vertices.
[0091] The target vertex coordinates are extracted in combination with the edge position of the target substrate and the target vertex. The accurate edge position of the target substrate is obtained by edge detection, fitting, and the like; and the key vertex is identified on the edge position according to the preset contour shape of the target substrate. A reference coordinate system can be an image coordinate system or a world coordinate system; and the coordinate values of each vertex in the coordinate system are calculated by using geometric methods or coordinate transformation. The target vertex coordinates refer to the specific positions of each vertex of the target substrate in the image or space coordinate system, usually represented by two-dimensional or three-dimensional coordinates.
[0092] The edge position area and the edge position shape are determined according to the target vertex coordinates and the edge position of the target substrate. The edge position area refers to the area of the region surrounded by the edge of the target substrate. If the edge of the target substrate is a simple geometric shape (such as a rectangle, a triangle, etc.), the area can be calculated by using geometric formulas according to the target vertex coordinates. If the edge shape is complex, the edge position can be approximated as a polygon, and then the polygon area calculation formula is used, or image processing techniques (such as pixel counting method) are used to estimate the area. The edge position shape refers to the geometric shape characteristics of the edge of the target substrate. Based on the vertex coordinates and the edge position, the shape can be determined by analyzing the arrangement of the vertices and the direction of the edge. For example, the curvature, direction change, and other characteristics of the edge are calculated by the vertex coordinates. The extracted edge position is matched with the preset standard shape to determine the shape type (such as a rectangle, a circle, etc.).
[0093] The edge position of the target substrate is verified by combining the edge position area, edge position shape, and preset contour shape. Specifically, the calculated edge position area is compared with the theoretical area of the target substrate (based on the preset contour shape). The edge position area refers to the area enclosed by the target substrate edge; the edge position shape describes the geometric features of the target substrate edge; and the preset contour shape is a pre-set, standard contour shape expected for the target substrate. The calculated edge position area is compared with a preset area range. If the area is within the preset range, the edge position is likely reasonable from an area perspective; if the area deviation is significant, it indicates that the edge position may be incorrect. The edge position shape descriptor is then matched or similarity calculated with the descriptor of the preset contour shape. For example, the Euclidean distance between the Fourier descriptor of the edge position shape and the Fourier descriptor of the preset contour shape is calculated, or the difference in invariant moments is calculated. If the similarity exceeds a preset threshold, the shape match is good; if the similarity is low, the edge shape does not conform to the preset.
[0094] If both the edge position area and edge position shape verification pass, the target substrate's edge position is determined. The measured edge position area is then compared with the theoretical area to determine if it is within the allowable error range. Shape matching algorithms and other methods can be used to compare the actual edge shape with the pre-determined shape to determine if it meets the requirements. If both verifications pass, the target substrate's edge position is determined to be accurate and used as the final edge position for subsequent operations.
[0095] By verifying the edge position area and edge position shape, the accuracy of the target substrate edge position is ensured, the reliability of the entire detection process is improved, and the work efficiency and accuracy are improved.
[0096] An embodiment of the present application further provides a machine-readable storage medium having stored thereon instructions for causing a machine to execute the above-mentioned printing cardboard positioning method based on visual image segmentation and edge detection.
[0097] An embodiment of the present application further provides an electronic device, including: a memory configured to store instructions; and The processor is configured to call instructions from the memory and implement the above-mentioned printing cardboard positioning method based on visual image segmentation and edge detection when executing the instructions.
[0098] Those skilled in the art will appreciate that embodiments of the application can be readily used as a method, a system or a computer program product. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0099] The application is described herein with reference to the Figures, which illustrate the described embodiments. 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 functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0100] 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 function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0101] 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 functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0102] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0103] The memory can include non-persistent memory and / or volatile memory, such as a random access memory (RAM) including a cache area for the temporary storage of data. The memory can also include non-volatile memory, such as read only memory (ROM) for storing structural information and / or instruction code. Both can be within one or more memory devices 1225. Alternatively, some memory devices can provide a combination of one or more of the foregoing types of memories. Since memory is a computer-readable medium, it can also include a medium that reflects, either mentally or
[0104] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0105] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0106] The above only is an embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A method for positioning printed paperboard based on vision image segmentation and edge detection, characterized in that, The method comprises the following steps: When the target substrate reaches the preset position, a parallel polarized camera and a cross polarized camera are used to capture a parallel polarized image and a cross polarized image of the target substrate respectively; A preset double-channel neural network is used to determine parallel polarized features and cross polarized features based on the parallel polarized image and the cross polarized image, and a parallel glare mask is determined based on the parallel polarized features; The cross polarized features are adjusted in feature weight based on the parallel glare mask to obtain adjusted cross polarized features; The adjusted cross polarized features and the parallel polarized features are fused to obtain a fusion feature map; The fusion feature map is input into a preset semantic segmentation network model to obtain an edge probability map of the target substrate; An edge position of the target substrate is determined based on the edge probability map using a contour connection algorithm.
2. The method of claim 1, wherein, The parallel polarized features include parallel glare features and parallel non-glare features, and the cross polarized features include cross glare features and cross non-glare features. The method comprises the following steps: A first branch channel of the preset double-channel neural network is used to extract brightness features and reflection intensity features of the parallel polarized image; Based on the brightness features and the reflection intensity features, brightness mean value and brightness standard deviation and reflection intensity mean value and reflection intensity standard deviation are calculated; The brightness mean value and the brightness standard deviation are combined to set a brightness threshold, and the reflection mean value and the reflection standard deviation are combined to set a reflection intensity threshold; Regions in the parallel polarized image with brightness features exceeding the brightness threshold and reflection intensity features exceeding the reflection intensity threshold are regarded as parallel glare regions; A second branch channel of the preset double-channel neural network is used to extract cross glare features and cross non-glare features of the cross polarized image; The parallel glare mask is determined based on the parallel glare regions; 3. The method of claim 2, wherein, In the parallel polarized image, the brightness features and the reflection intensity features of the parallel glare features are maximum features under preset conditions, and in the cross polarized image, the texture features and the edge features of the cross glare features are maximum features under preset conditions. The method comprises the following steps: The second branch channel of the preset double-channel neural network is used to extract texture features and edge features of the cross polarized image; Based on the edge features, edge gradient amplitude and edge pixel connection degree are determined; When the edge gradient amplitude is greater than or equal to a preset edge gradient threshold and the edge pixel connection degree is greater than or equal to a preset edge connection degree threshold, the cross non-glare features are determined; When the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is less than the preset edge connection degree threshold, the cross glare features are determined; When the edge gradient amplitude is greater than or equal to the preset edge gradient threshold and the edge pixel connection degree is less than the preset edge connection degree threshold, texture complexity is calculated based on the texture features; When the texture complexity does not exceed a preset texture feature threshold, the cross glare features are determined. When the edge gradient amplitude is less than the preset edge gradient threshold and the edge pixel connection degree is greater than or equal to the preset edge connection degree threshold, an edge gray mean value is calculated according to the edge feature; When the edge gray mean value exceeds the preset gray threshold, the cross glare feature is determined.
4. The method of claim 1, wherein, The step of adjusting the cross-polarization feature based on the parallel glare mask to obtain an adjusted cross-polarization feature includes the following steps: Spatial position matching is performed between the parallel glare mask and the cross-polarization feature to determine the spatial correspondence between each parallel glare mask and the cross-polarization feature. The pixel value of the parallel glare mask corresponding to the cross-polarization feature is determined according to the spatial correspondence. The cross-polarization feature value is determined based on the cross-polarization feature. An adjustment weight is calculated according to the pixel value of the parallel glare mask and the preset weight factor. The product of the adjustment weight and the cross-polarization feature value is calculated to obtain the adjusted cross-polarization feature.
5. The method of claim 1, wherein, The step of combining the adjusted cross-polarization feature and the parallel polarization feature to obtain a fused feature map includes the following steps: The adjusted cross-polarization feature and the parallel polarization feature are respectively constructed into a first feature hierarchical structure and a second feature hierarchical structure. The weight values of each feature in the first feature hierarchical structure and the weight values of each feature in the second feature hierarchical structure are calculated. The overall weight map is constructed by combining the weight values in the first feature hierarchical structure and the weight values in the second feature hierarchical structure. Based on the overall weight map, the first feature hierarchical structure and the second feature hierarchical structure, the features of the same level are spliced to obtain the fused features according to the corresponding levels. The Laplacian pyramid is constructed according to the fused features to obtain the fused feature map.
6. The method of claim 5, wherein, The step of constructing the first feature hierarchical structure and the second feature hierarchical structure from the adjusted cross-polarization feature and the parallel polarization feature includes the following steps: Local brightness change features and local reflection intensity features are extracted based on the parallel polarization feature, and the local brightness change features and the local reflection intensity features are taken as first-level features; Second-level features are obtained by clustering analysis of the local brightness change features and the local reflection intensity features; Global brightness features and global reflection features are extracted based on the parallel polarization feature as third-level features; The first feature hierarchical structure is constructed based on the first-level features, the second-level features and the third-level features; Texture fine-grained features and edge fine-grained features are extracted based on the adjusted cross-polarization feature, and the texture fine-grained features and the edge fine-grained features are taken as fourth-level features; Texture local features and edge local contour features are obtained by clustering analysis of the texture fine-grained features and the edge fine-grained features, and the texture local features and the edge local contour features are taken as fifth-level features; Edge overall contour features and texture overall features are extracted based on the adjusted cross-polarization feature to obtain sixth-level features; The second feature hierarchical structure is constructed by combining the fourth-level features, the fifth-level features and the sixth-level features.
7. The method of claim 1, wherein, The step of determining the edge position of the target substrate based on the edge probability map using the contour connection algorithm includes the following steps: transforming the edge probability map into an edge binary map, wherein a pixel point in the edge binary map with a probability value greater than or equal to a preset threshold is regarded as an edge point, and a pixel point in the edge binary map with a probability value less than the preset threshold is regarded as a non-edge point; determining discrete edge segments in the edge binary map by using a contour detection algorithm; calculating the length of each discrete edge segment, and regarding a discrete edge segment with a length greater than a preset length threshold as an effective discrete edge segment; calculating the distance between each effective discrete edge segment, and connecting effective discrete edge segments with a distance less than a preset distance threshold to determine an initial edge position of the target substrate; performing edge fitting on the initial edge position based on a preset contour shape of the target substrate to determine the edge position of the target substrate.
8. The method of claim 7, wherein, The method further comprises the following steps: determining a target vertex according to the preset contour shape of the target substrate; extracting a target vertex coordinate in combination with the edge position of the target substrate and the target vertex; determining an edge position area and an edge position shape according to the target vertex coordinate and the edge position of the target substrate; verifying the edge position of the target substrate in combination with the edge position area, the edge position shape, and the preset contour shape; if the edge position area and the edge position shape pass the verification, determining the edge position of the target substrate.
9. A machine-readable storage medium, characterized in that, The machine readable storage medium stores instructions for causing a machine to perform the method of positioning a printed paperboard based on visual image segmentation and edge detection according to any one of claims 1 to 8.
10. An electronic device, comprising: comprises: a memory configured to store instructions; and a processor configured to call the instructions from the memory and enable the method of positioning a printed paperboard based on visual image segmentation and edge detection according to any one of claims 1 to 8 when the instructions are executed.
Citation Information
Patent Citations
Polarization imaging system with super-resolution fusion
CN115235999A
Skin state detection method and device
CN116342549A
Underwater micro-plastic detection method and system and storage medium
CN119354891A
Waste plastic classification method and system based on visual identification
CN120375085A
Image processing apparatus, image pickup apparatus, and image processing method
US20220006992A1
Cited By
Automatic finished product bubble removing cooperative control method and system based on machine vision
CN122143411A
Automatic finished product defoaming cooperative control method and system based on machine vision
CN122143411B