Leather surface defect recognition method and system based on deep visual feature analysis
Patent Information
- Application Number
- CN202611204344.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-13
AI Technical Summary
然而,在深色油蜡皮经低温压光后进行高速输送检测时,皮革边缘区域易形成随输送振动变化的条带状镜面反光,部分深度小于皮纹起伏的浅裂纹仅在特定斜入射方向下产生微弱亮度衰减
本发明区别于仅利用单幅可见光图像进行缺陷判断的现有技术,通过在皮革连续输送过程中同步获取正向照明图像和两幅不同方向的斜向偏振图像,并利用输送编码脉冲对三幅图像进行实际位置配准,再由两幅斜向偏振图像的对应像素差异构建方向反射残差图。该技术手段能够在消除输送位移干扰的同时,将浅裂纹在不同入射方向下产生的微弱反射差异从深色背景、天然粒面及镜面反光中分离出来,直接提高浅裂纹光学表征的稳定性和可辨识度,减少因图像错位及反光变化造成的缺陷特征消失或伪差异。
Smart Images

Figure CN122906035A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of leather surface defect detection technology, and specifically to a method and system for identifying leather surface defects based on depth visual feature analysis. Background Technology
[0002] In existing technologies, single visible light images and deep neural networks are typically used to identify defects such as scratches and pinholes on the leather surface. However, when dark-colored waxed leather is subjected to high-speed conveying inspection after low-temperature calendering, the leather edge area is prone to forming strip-shaped specular reflections that change with conveying vibration. Some shallow cracks, whose depth is less than the undulation of the leather grain, only produce a slight brightness attenuation under specific oblique incident directions. These shallow cracks are highly similar to the grayscale, morphology, and depth characteristics of natural grain texture in a single image. The specular reflections can also cause the defect features to disappear intermittently, easily leading to missed detections. As a result, leather with shallow cracks may experience coating cracking after entering the finishing process. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for identifying defects on leather surfaces based on depth visual feature analysis, so as to overcome the shortcomings of the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for identifying leather surface defects based on depth visual feature analysis, comprising: Acquire a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected in the transport state; The three images are registered according to the transmitted encoding pulse, and a directional reflection residual map is generated based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image. The forward illumination image and the directional reflection residual map are input into the depth vision feature parsing network to extract grain surface semantic features and reflection change features, respectively. Based on the reflection change features, the grain surface semantic features are channel-weighted to obtain defect candidate features. The texture extension direction of the candidate region is calculated based on the defect candidate features, and the reflection attenuation continuity of the candidate region at adjacent transport positions is determined by combining the directional reflection residual map, thereby generating defect consistency features. When the texture extension direction of the candidate region is continuous and the reflection attenuation continuity is greater than a preset threshold, the candidate region is identified as a shallow crack defect, and the location and outline of the shallow crack defect are output.
[0005] Preferably, acquiring the forward illumination image, the first oblique polarization image, the second oblique polarization image, and the transport coded pulse of the leather to be inspected in the transport state includes: The leather to be inspected is continuously moved along the preset conveying direction by the conveying mechanism. When the leather to be inspected passes the preset detection position, a positive illumination image is captured by an image acquisition device set above the conveying mechanism. The surface of the leather to be inspected is obliquely illuminated from both sides of the preset conveying direction, and a first oblique polarization image and a second oblique polarization image corresponding to the same inspection area are acquired under polarization conditions. When acquiring each image, the corresponding transport code pulse value is recorded. The transport mechanism generates one transport code pulse for each preset distance it moves.
[0006] Preferably, position registration of the three images is performed based on the transmitted encoded pulses, including: Using the forward illumination image as a reference image, the pulse difference between the transport code pulse value corresponding to the first oblique polarization image and the second oblique polarization image and the transport code pulse value corresponding to the forward illumination image is calculated respectively. Based on the pulse difference and the transmission distance corresponding to a single transmission coded pulse, the transmission displacement of the first oblique polarized image and the second oblique polarized image relative to the positive illumination image is determined; Based on the actual distance to the leather surface corresponding to a single pixel, the transport displacement is converted into a pixel offset, and the first oblique polarization image and the second oblique polarization image are moved according to the pixel offset.
[0007] Preferably, generating a directional reflection residual map based on the corresponding pixel differences between the first oblique polarization image and the second oblique polarization image includes: The common overlapping area of the forward illumination image, the first oblique polarization image, and the second oblique polarization image after position adjustment is determined, and the non-overlapping edge areas are cropped to obtain forward registration image, first oblique registration image, and second oblique registration image of the same size; Calculate the absolute value of the pixel value difference between corresponding pixels in the first oblique registration image and the second oblique registration image to obtain the directional reflection residual value at each pixel position; Arrange the directional reflection residual values according to the pixel positions corresponding to the directional reflection residual values to generate a directional reflection residual map with the same size as the forward registered image.
[0008] Preferably, the deep visual feature parsing network includes a grain surface semantic feature extraction branch and a reflectance variation feature extraction branch, wherein the extraction of grain surface semantic features and reflectance variation features respectively includes: The forward-registered image is input into the grain semantic feature extraction branch, and multi-layer convolution processing is performed on the color changes, grain texture, texture edges and local morphology in the forward-registered image to obtain the grain semantic features; The directional reflection residual map is input into the reflection variation feature extraction branch, and the reflection difference of the leather surface under different oblique lighting directions is processed by multi-layer convolution to obtain the reflection variation feature. The grain semantic features and reflection variation features are set to have the same feature map height, feature map width, and number of feature channels, and their same spatial position corresponds to the same actual position on the leather surface.
[0009] Preferably, the semantic features of the grain surface are channel-weighted based on the reflection change characteristics, including: For each feature channel of the reflection change characteristics, calculate the average value of each feature value in that feature channel to obtain the corresponding channel reflection description value; The mapping parameters obtained from training the deep visual feature parsing network are used to map and normalize the reflection description values of each channel, resulting in channel weights with values ranging from 0 to 1. The weights of each channel are multiplied by the corresponding feature channels of the granular semantic features to obtain the defect candidate features.
[0010] Preferably, the candidate region is determined based on the defect candidate features, including: The absolute values of the feature values of each feature channel at the same spatial location in the defect candidate features are averaged to obtain the defect candidate response map; Based on the size ratio between the defect candidate response map and the directional reflection residual map, the defect candidate response map is sized and normalized so that the same pixel positions in the defect candidate response map and the directional reflection residual map correspond to the same actual positions on the leather surface to be detected. Pixels whose normalized response values are greater than a preset candidate threshold are identified as candidate pixels, and adjacent candidate pixels are divided into the same candidate region.
[0011] Preferably, the texture extension direction of the candidate region is calculated based on the defect candidate features, including: Along the conveying direction of the leather to be inspected, each candidate area is divided into multiple local areas arranged sequentially and having the same preset longitudinal width; Based on the difference in response values between adjacent pixels in each local region of the defect candidate response map, the horizontal gradient and vertical gradient are calculated, and a direction matrix is constructed based on the horizontal gradient and vertical gradient. The direction perpendicular to the eigenvector corresponding to the high eigenvalue in the direction matrix is determined as the texture extension direction of the corresponding local region. Calculate the directional difference between the texture extension directions of adjacent local regions, and determine the directional continuity of candidate regions based on each directional difference.
[0012] Preferably, determining the continuity of reflection attenuation in candidate regions at adjacent transport locations and identifying shallow crack defects includes: The directional reflection residual map is normalized, and the average directional reflection residual value corresponding to the candidate pixels in each local region is calculated. The average reflection response of the candidate region and the reflection change between adjacent local regions are determined based on the average directional reflection residual value. The reflection attenuation continuity is determined based on the average reflection response and the reflection change, and the directional continuity and the reflection attenuation continuity are combined into a defect consistency feature; When the directional continuity is not less than the preset directional continuity threshold and the reflection attenuation continuity is greater than the preset reflection continuity threshold, the corresponding candidate region is identified as a shallow crack defect. The candidate region is mapped to the forward registration image, and the center position coordinates of the candidate region and the defect contour composed of boundary pixels are output.
[0013] This invention also provides a leather surface defect identification system based on depth visual feature analysis, comprising: The image acquisition module acquires a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected in the transport state. The image registration and residual generation module performs position registration on the three images according to the transmitted encoding pulse, and generates a directional reflection residual map based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image. The deep feature parsing module inputs the forward illumination image and the directional reflection residual map into the deep visual feature parsing network, extracts the grain surface semantic features and reflection change features respectively, and performs channel weighting on the grain surface semantic features based on the reflection change features to obtain defect candidate features; The defect consistency feature generation module calculates the texture extension direction of the candidate region based on the defect candidate features, and determines the continuity of reflection attenuation of the candidate region at adjacent transport positions by combining the directional reflection residual map, thereby generating defect consistency features. The output module identifies the candidate region as a shallow crack defect when the texture extension direction of the candidate region is continuous and the reflection attenuation continuity is greater than a preset threshold, and outputs the location and outline of the shallow crack defect.
[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This invention differs from existing technologies that rely solely on single visible light images for defect assessment. It simultaneously acquires a forward-illuminated image and two obliquely polarized images from different directions during continuous leather transport. The three images are then registered using transport encoding pulses, and a directional reflection residual map is constructed from the corresponding pixel differences between the two obliquely polarized images. This technique eliminates transport displacement interference while separating the subtle reflection differences caused by shallow cracks under different incident directions from dark backgrounds, natural grain surfaces, and specular reflections. This directly improves the stability and recognizability of the optical characterization of shallow cracks, reducing the disappearance of defect features or false differences caused by image misalignment and changes in reflection.
[0015] This invention further distinguishes itself from existing technologies that identify defects solely based on texture response or a single classification result. It uses channel weighting of grain semantic features based on reflection variation characteristics and combines the continuity of texture extension and reflection attenuation along the transport direction of candidate regions for consistency determination. This technique utilizes both the linear extension morphology and continuous directional reflection characteristics of shallow cracks during the identification process, suppressing false defect responses caused by random grain surfaces, local color differences, minor depressions, and transient specular reflections. This improves the reliability of detecting low-contrast, shallow-depth cracks and directly obtains the actual location and continuous outline of defects on the leather surface, providing accurate information for subsequent sorting, avoidance, or quality traceability. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a flowchart of the method of the present invention.
[0018] Figure 2 This is a schematic diagram of image acquisition according to the present invention.
[0019] Figure 3 This is a flowchart of the system modules of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1, please refer to Figure 1 and Figure 2 As shown in this embodiment, the leather surface defect identification method based on depth visual feature analysis includes: Acquire a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport encoding pulse of the leather to be inspected in the transport state.
[0022] Specifically, on a leather processing production line, the leather to be inspected is placed on a conveyor mechanism, allowing it to move continuously along a preset conveying direction. During this movement, an image acquisition device positioned above the conveyor mechanism continuously captures images of the leather surface. Specifically, the leather surface is illuminated using forward illumination, and forward illumination images are acquired. These images are used to characterize the overall texture distribution and color information of the leather surface.
[0023] Simultaneously, oblique polarization acquisition methods are set on both sides of the image acquisition device to acquire polarized images of the leather surface from different oblique illumination angles, resulting in a first oblique polarized image and a second oblique polarized image. Because the leather surface has structural differences such as grain texture, micro-depressions, and shallow cracks, the reflection characteristics produced under different oblique illumination directions vary. By acquiring polarized images in different directions, the optical changes in the leather surface caused by micro-deformations can be preserved.
[0024] While acquiring the above image data, a coding detection device installed on the conveying mechanism collects the conveying coding pulses during the leather conveying process. The conveying coding pulses are used to record the movement state of the leather during the conveying process, so that the continuously acquired positive illumination image, the first oblique polarization image and the second oblique polarization image correspond to the actual position of the leather surface.
[0025] The three images are registered according to the transmitted encoding pulse, and a directional reflection residual map is generated based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image.
[0026] In this embodiment, the leather to be inspected is placed on a conveyor mechanism and moves continuously along a preset conveying direction. During image acquisition, the leather to be inspected moves synchronously with the conveyor mechanism so that the moving distance of the conveyor mechanism can characterize the moving distance of the leather to be inspected.
[0027] When the leather to be tested passes through a preset detection position, a forward illumination image, a first oblique polarized image, and a second oblique polarized image are acquired for the same detection area on the surface of the leather. The forward illumination image is used to characterize the overall color and grain texture of the leather surface; the first oblique polarized image and the second oblique polarized image are used to characterize the difference in reflection of the leather surface under different oblique illumination directions.
[0028] Specifically, when acquiring the forward illumination image, illumination is provided directly above the surface of the leather to be inspected; when acquiring the first oblique polarized image and the second oblique polarized image, oblique illumination is provided from both sides of the leather conveying direction, and corresponding images are acquired under polarization conditions. The first oblique polarized image and the second oblique polarized image use the same image size and acquisition range, so that the two images can reflect the reflection state of the same detection area under different oblique illumination directions.
[0029] While acquiring each image, the corresponding transport code pulse value for each image is recorded. The transport mechanism generates one transport code pulse for every preset distance it moves. Therefore, based on the difference between the transport code pulse values corresponding to any two images, the transport distance of the leather to be inspected during the acquisition of those two images can be determined.
[0030] In this embodiment, the forward illumination image is used as the reference image for position registration. The pulse difference between the transport coded pulse values corresponding to the first oblique polarized image and the second oblique polarized image and the transport coded pulse value corresponding to the forward illumination image is calculated respectively. The pulse difference is then multiplied by the transport distance corresponding to a single transport coded pulse to obtain the transport displacement of the corresponding oblique polarized image relative to the forward illumination image.
[0031] Based on the actual distance to the leather surface corresponding to a single pixel in the image, the conveying displacement is converted into a pixel offset along the conveying direction. According to this pixel offset, the first oblique polarized image and the second oblique polarized image are shifted respectively, so that corresponding pixels in the three images represent the same actual position on the leather surface to be detected. When the calculated pixel offset is not an integer, the movement is performed according to the integer pixel closest to that offset.
[0032] After the position movement is completed, the common overlapping area of the forward illumination image, the first oblique polarization image, and the second oblique polarization image is determined, and the edge areas that do not overlap with other images after the movement are removed, resulting in forward registration images, first oblique registration images, and second oblique registration images of the same size and corresponding positions.
[0033] Furthermore, corresponding pixels in the first and second obliquely registered images are compared. For any pixel location, the pixel value at that location in the first obliquely registered image is subtracted from the pixel value at the same location in the second obliquely registered image, and the absolute value of the difference is taken as the directional reflection residual value at that pixel location, expressed as: Where (R(x,y)) represents the directional reflection residual value at pixel position ((x,y)). This represents the pixel value at pixel position ((x,y)) in the first obliquely registered image. This represents the pixel value at pixel position ((x,y)) of the second obliquely registered image.
[0034] The directional reflection residual values for each pixel location within the common overlapping area are calculated using the method described above, and a directional reflection residual map is generated according to the arrangement of the pixel locations. The size of the directional reflection residual map is the same as that of the three registered images. The larger the directional reflection residual value, the more significant the reflection difference of the corresponding leather surface location under the two oblique illumination directions; the smaller the directional reflection residual value, the weaker the reflection difference of the corresponding location under the two oblique illumination directions.
[0035] Because the shallow cracks, minute depressions, and grain undulations on the leather surface create different variations in brightness under different oblique lighting directions, the directional reflection residual map can highlight the directional reflection variations of the leather surface. Thus, a forwardly registered image and a directional reflection residual map corresponding to each other's positions are obtained, providing input data for subsequent extraction of grain semantic features and reflection variation features.
[0036] The forward illumination image and directional reflection residual map are input into the depth vision feature parsing network to extract grain surface semantic features and reflection change features, respectively. Based on the reflection change features, the grain surface semantic features are channel-weighted to obtain defect candidate features.
[0037] In this embodiment, the forward illumination image and directional reflection residual map after location registration and cropping of the common overlapping area are input into a pre-trained deep visual feature parsing network to obtain defect candidate features that can characterize leather surface defects.
[0038] Specifically, the deep visual feature parsing network includes a grain-surface semantic feature extraction branch and a reflectance variation feature extraction branch. The grain-surface semantic feature extraction branch takes the forward-illuminated image as input, while the reflectance variation feature extraction branch takes the directional reflectance residual map as input. Both feature extraction branches perform multi-layer convolution processing on the input image to extract image features at different levels.
[0039] The grain semantic feature extraction branch analyzes color changes, grain texture, texture edges, and local morphology in the positively lit image to obtain grain semantic features. These grain semantic features include not only the normal grain distribution on the leather surface but also local semantic changes that may be caused by shallow cracks, minor depressions, or abnormal textures.
[0040] The reflection variation feature extraction branch analyzes the directional reflection residual map to extract the reflection differences of various regions on the leather surface under two oblique lighting directions, thus obtaining the reflection variation features. These reflection variation features are used to characterize the intensity and distribution of reflection changes on the leather surface under different directional lighting conditions.
[0041] To facilitate subsequent channel weighting, the granular semantic features and reflectance variation features have the same number of feature channels. Let the granular semantic features be: The characteristics of the reflection change are: ;in, and These represent the height and width of the feature map, respectively. This indicates the number of feature channels. The same spatial location in the grain semantic feature and the reflectance variation feature corresponds to the same actual location on the surface of the leather to be detected.
[0042] Furthermore, for each feature channel of the reflection change characteristics, the average value of each feature value within that feature channel is calculated to obtain the corresponding channel reflection description value, the expression of which is: ;in, Indicates the first Channel reflection description values for each feature channel. Indicates the spatial location of reflection variation characteristics Passing the exam The eigenvalues at each feature channel.
[0043] The reflection description values of each channel are mapped and normalized to obtain the channel weights corresponding to the semantic feature channels of each granular surface. The channel weights of each feature channel can be expressed as: ;in, Indicates the first Channel weights for each feature channel. and The mapping parameters are defined by the deep visual feature parsing network during training, and the channel weights range from 0 to 1.
[0044] The corresponding channels of the granular semantic features are weighted according to their respective channel weights to obtain the defect candidate features, the expression of which is: ;in, Indicates the spatial location of defect candidate features Passing the exam The eigenvalues at each feature channel.
[0045] After the network training is completed, the feature channels related to abnormal directional reflection on the leather surface have relatively large channel weights, which preserves and enhances the features related to shallow cracks or small depressions in the grain semantic features; the feature channels related to normal grain repetitive textures or non-directional color changes have relatively small channel weights, which suppress the corresponding features.
[0046] Therefore, the defect candidate features simultaneously contain grain semantic information in the forward illumination image and reflection change information in the directional reflection residual map, and maintain a spatial correspondence with the position of the leather surface to be detected, providing a data basis for subsequent calculation of the texture extension direction of the candidate region based on the defect candidate features.
[0047] The texture extension direction of the candidate region is calculated based on the defect candidate features, and the reflection attenuation continuity of the candidate region at adjacent transport positions is determined by combining the directional reflection residual map, thus generating defect consistency features. When the texture extension direction of the candidate region is continuous as characterized by the defect consistency features and the reflection attenuation continuity is greater than a preset threshold, the candidate region is identified as a shallow crack defect, and the location and contour of the shallow crack defect are output. ;in, , and These represent the height, width, and number of feature channels of the defect candidate feature, respectively. Aggregating the feature channels of the defect candidate feature yields the defect candidate response map: ;in, Indicates feature location Defect candidate response value at the location, Indicates the defect candidate feature at the feature location and the The eigenvalues at each feature channel.
[0048] When the size of the defect candidate response map is smaller than the size of the forward illumination image and the directional reflection residual map, the defect candidate response map is resized according to the size ratio between the defect candidate response map and the input image, so that the adjusted defect candidate response map has the same height and width as the directional reflection residual map. Therefore, the same pixel positions in the adjusted defect candidate response map and the directional reflection residual map correspond to the same actual position on the surface of the leather to be detected.
[0049] The adjusted defect candidate response map is normalized so that its response value falls within the range of zero to one. Pixels with response values greater than a preset candidate threshold are identified as candidate pixels, and adjacent candidate pixels are grouped into the same candidate region, resulting in at least one candidate region. The preset candidate threshold can be pre-determined based on leather samples marked with shallow crack defects and remains unchanged during actual testing.
[0050] In this embodiment, the image coordinate direction corresponding to the leather conveying direction is defined as the longitudinal direction, and the image coordinate direction perpendicular to the leather conveying direction is defined as the transverse direction. For each candidate region, the candidate region is divided into multiple sequentially arranged local regions along the longitudinal direction. Each local region has the same preset longitudinal width, and each local region corresponds to a continuous position interval on the leather surface along the conveying direction. The local regions are sequentially denoted according to the leather conveying direction as follows: ;in, This indicates the number of local regions contained in the candidate region.
[0051] Furthermore, the texture extension direction of each local region is calculated based on the defect candidate response map. Specifically, the lateral gradient of each pixel is calculated based on the difference in response values between adjacent pixels within the local region. and longitudinal gradient And targeting the first Construct a direction matrix for each local region: The eigenvector corresponding to the larger eigenvalue in the direction matrix represents the direction in which the response value changes most significantly within a local region. The direction perpendicular to this eigenvector is determined as the texture extension direction of that local region, and this texture extension direction is denoted as... .
[0052] Since the texture extension direction does not distinguish between forward and reverse directions, the directional difference between two adjacent local regions is expressed as: ;in, The value range is from zero to... The directional continuity of the candidate region is calculated based on the directional differences between adjacent local regions. ;in, The directional continuity of the candidate region is represented, ranging from 0 to 1. A directional continuity closer to 1 indicates a more stable texture extension direction in adjacent transport positions; a directional continuity closer to 0 indicates a more pronounced change in texture direction. When there is no linear response with a unique extension direction within a local region, the directional continuity of that candidate region is set to 0.
[0053] Furthermore, the continuity of reflection attenuation in candidate regions at adjacent transport positions is determined based on the directional reflection residual map. First, the pixel values in the directional reflection residual map are normalized to a range of 0 to 1. For each local region, the average directional reflection residual value corresponding to the candidate pixels within that local region is calculated: ;in, Indicates the first The average directional reflection residual value of each local region Represents the pixel position in the directional reflection residual map Normalized directional reflection residual value at the location, Indicates the first The number of candidate pixels within a local region.
[0054] Calculate the average reflection response of the candidate region based on the average directional reflection residual value of each local region: And calculate the change in reflection between adjacent local areas: The continuity of reflection attenuation is determined based on the average reflection response and the change in reflection. ;in, The reflection attenuation continuity is represented by a value ranging from 0 to 1. The average reflection response characterizes whether there is a significant directional reflection difference in the candidate region, and the reflection change characterizes whether this directional reflection difference abruptly occurs between adjacent transport positions. Therefore, a large reflection attenuation continuity can only be obtained when the candidate region has a certain directional reflection response and this directional reflection response is continuously distributed along the transport direction, thereby avoiding ordinary grain textures with an overall reflection residual close to zero being judged as having high reflection continuity.
[0055] The directional continuity and reflection attenuation continuity of the candidate region are combined to generate the defect consistency feature of the candidate region: The defect consistency feature is used to simultaneously characterize the linear extension stability and directional reflection change stability of the candidate region.
[0056] The directional continuity is compared with a preset directional continuity threshold, and the reflection attenuation continuity is compared with a preset reflection continuity threshold. When the directional continuity of a candidate region is not less than the preset directional continuity threshold, and the reflection attenuation continuity is greater than the preset reflection continuity threshold, the texture extension direction of the candidate region is determined to be continuous, and the candidate region has continuous directional reflection changes at adjacent transport positions. The candidate region is then identified as a shallow crack defect. Otherwise, the candidate region is not identified as a shallow crack defect. The preset directional continuity threshold and the preset reflection continuity threshold can be determined based on pre-collected and labeled shallow crack samples and normal grain surface samples, and remain unchanged during the actual testing process of the leather to be tested.
[0057] Finally, the candidate regions identified as shallow crack defects are mapped onto the position-registered forward-illuminated image. The outermost boundary pixels of the candidate region are extracted and arranged according to their adjacency to obtain the outline of the shallow crack defect. The average value of all pixel coordinates within the candidate region is calculated to obtain the center coordinates of the shallow crack defect in the forward-illuminated image.
[0058] Based on the actual distance to the leather surface corresponding to a single pixel in the forward-illuminated image, the center position coordinates and contour pixel coordinates are converted into actual leather surface size coordinates. Combined with the transport encoding pulse corresponding to the acquisition of the forward-illuminated image, the actual position of the shallow crack defect along the leather transport direction is determined. Thus, the position coordinates of the shallow crack defect and the defect contour composed of multiple boundary coordinate points are output.
[0059] This invention addresses the problem that shallow cracks on the surface of dark-colored oil-waxed leather and other leathers are similar to natural grain textures and are easily interfered with by specular reflections, making them difficult to identify stably. It simultaneously acquires images under positive illumination and images with different oblique polarizations, uses transmitted encoded pulses to complete image position registration and constructs a directional reflection residual map, and then uses a deep visual feature parsing network to extract grain semantic features and reflection variation features respectively. The reflection variation features are used to perform channel weighting on the grain semantic features to obtain defect candidate features that take into account both texture morphology and directional reflection differences. Furthermore, consistency is determined by combining the continuity of the texture extension direction of the candidate region and the continuity of reflection attenuation at adjacent transmission positions, thereby distinguishing continuous linear shallow cracks from random grains, local color differences, and instantaneous reflections, and outputting the location and outline of the shallow crack defect.
[0060] Example 2, please refer to Figure 3 As shown in this embodiment, the leather surface defect identification system based on depth visual feature analysis includes: The image acquisition module acquires a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected in the transport state. The image registration and residual generation module performs position registration on the three images according to the transmitted encoding pulse, and generates a directional reflection residual map based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image. The deep feature parsing module inputs the forward illumination image and the directional reflection residual map into the deep visual feature parsing network, extracts the grain surface semantic features and reflection change features respectively, and performs channel weighting on the grain surface semantic features based on the reflection change features to obtain defect candidate features; The defect consistency feature generation module calculates the texture extension direction of the candidate region based on the defect candidate features, and determines the continuity of reflection attenuation of the candidate region at adjacent transport positions by combining the directional reflection residual map, thereby generating defect consistency features. The output module identifies the candidate region as a shallow crack defect when the texture extension direction of the candidate region is continuous and the reflection attenuation continuity is greater than a preset threshold, and outputs the location and outline of the shallow crack defect.
[0061] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for identifying leather surface defects based on depth visual feature analysis, characterized in that, include: Acquire a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected in the transport state; The three images are registered according to the transmitted encoding pulse, and a directional reflection residual map is generated based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image. The forward illumination image and the directional reflection residual map are input into the depth vision feature parsing network to extract grain surface semantic features and reflection change features, respectively. Based on the reflection change features, the grain surface semantic features are channel-weighted to obtain defect candidate features. The texture extension direction of the candidate region is calculated based on the defect candidate features, and the reflection attenuation continuity of the candidate region at adjacent transport positions is determined by combining the directional reflection residual map, thereby generating defect consistency features. When the texture extension direction of the candidate region is continuous and the reflection attenuation continuity is greater than a preset threshold, the candidate region is identified as a shallow crack defect, and the location and outline of the shallow crack defect are output.
2. The leather surface defect identification method based on depth visual feature analysis according to claim 1, characterized in that, Acquiring the following: a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected during transport; The leather to be inspected is continuously moved along the preset conveying direction by the conveying mechanism. When the leather to be inspected passes the preset detection position, a positive illumination image is captured by an image acquisition device set above the conveying mechanism. The surface of the leather to be inspected is obliquely illuminated from both sides of the preset conveying direction, and a first oblique polarization image and a second oblique polarization image corresponding to the same inspection area are acquired under polarization conditions. When acquiring each image, the corresponding transport code pulse value is recorded. The transport mechanism generates one transport code pulse for each preset distance it moves.
3. The leather surface defect identification method based on depth visual feature analysis according to claim 2, characterized in that, Position registration of the three images is performed based on the transmitted encoded pulses, including: Using the forward illumination image as a reference image, the pulse difference between the transport code pulse value corresponding to the first oblique polarization image and the second oblique polarization image and the transport code pulse value corresponding to the forward illumination image is calculated respectively. Based on the pulse difference and the transmission distance corresponding to a single transmission coded pulse, the transmission displacement of the first oblique polarized image and the second oblique polarized image relative to the positive illumination image is determined; Based on the actual distance to the leather surface corresponding to a single pixel, the transport displacement is converted into a pixel offset, and the first oblique polarization image and the second oblique polarization image are moved according to the pixel offset.
4. The leather surface defect identification method based on depth visual feature analysis according to claim 3, characterized in that, A directional reflection residual map is generated based on the corresponding pixel differences between the first oblique polarization image and the second oblique polarization image, including: The common overlapping area of the forward illumination image, the first oblique polarization image, and the second oblique polarization image after position adjustment is determined, and the non-overlapping edge areas are cropped to obtain forward registration image, first oblique registration image, and second oblique registration image of the same size; Calculate the absolute value of the pixel value difference between corresponding pixels in the first oblique registration image and the second oblique registration image to obtain the directional reflection residual value at each pixel position; Arrange the directional reflection residual values according to the pixel positions corresponding to the directional reflection residual values to generate a directional reflection residual map with the same size as the forward registered image.
5. The leather surface defect identification method based on depth visual feature analysis according to claim 1, characterized in that, The deep visual feature parsing network includes a grain surface semantic feature extraction branch and a reflectance variation feature extraction branch. The extraction of grain surface semantic features and reflectance variation features respectively includes: The forward-registered image is input into the grain semantic feature extraction branch, and multi-layer convolution processing is performed on the color changes, grain texture, texture edges and local morphology in the forward-registered image to obtain the grain semantic features; The directional reflection residual map is input into the reflection variation feature extraction branch, and the reflection difference of the leather surface under different oblique lighting directions is processed by multi-layer convolution to obtain the reflection variation feature. The grain semantic features and reflection variation features are set to have the same feature map height, feature map width, and number of feature channels, and their same spatial position corresponds to the same actual position on the leather surface.
6. The leather surface defect identification method based on depth visual feature analysis according to claim 5, characterized in that, Based on reflection variation characteristics, channel weighting is applied to the granular semantic features, including: For each feature channel of the reflection change characteristics, calculate the average value of each feature value in that feature channel to obtain the corresponding channel reflection description value; The mapping parameters obtained from training the deep visual feature parsing network are used to map and normalize the reflection description values of each channel, resulting in channel weights with values ranging from 0 to 1. The weights of each channel are multiplied by the corresponding feature channels of the granular semantic features to obtain the defect candidate features.
7. The leather surface defect identification method based on depth visual feature analysis according to claim 6, characterized in that, Candidate regions are determined based on defect candidate features, including: The absolute values of the feature values of each feature channel at the same spatial location in the defect candidate features are averaged to obtain the defect candidate response map; Based on the size ratio between the defect candidate response map and the directional reflection residual map, the defect candidate response map is sized and normalized so that the same pixel positions in the defect candidate response map and the directional reflection residual map correspond to the same actual position on the leather surface to be detected. Pixels whose normalized response values are greater than a preset candidate threshold are identified as candidate pixels, and adjacent candidate pixels are divided into the same candidate region.
8. The leather surface defect identification method based on depth visual feature analysis according to claim 7, characterized in that, The texture extension direction of the candidate region is calculated based on the defect candidate features, including: Along the conveying direction of the leather to be inspected, each candidate area is divided into multiple local areas arranged sequentially and having the same preset longitudinal width; Based on the difference in response values between adjacent pixels in each local region of the defect candidate response map, the horizontal gradient and vertical gradient are calculated, and a direction matrix is constructed based on the horizontal gradient and vertical gradient. The direction perpendicular to the eigenvector corresponding to the high eigenvalue in the direction matrix is determined as the texture extension direction of the corresponding local region. Calculate the directional difference between the texture extension directions of adjacent local regions, and determine the directional continuity of candidate regions based on each directional difference.
9. The method for identifying leather surface defects based on depth visual feature analysis according to claim 8, characterized in that, Determining the continuity of reflection attenuation in candidate regions at adjacent transport locations and identifying shallow crack defects includes: The directional reflection residual map is normalized, and the average directional reflection residual value corresponding to the candidate pixels in each local region is calculated. The average reflection response of the candidate region and the reflection change between adjacent local regions are determined based on the average directional reflection residual value. The reflection attenuation continuity is determined based on the average reflection response and the reflection change, and the directional continuity and the reflection attenuation continuity are combined into a defect consistency feature; When the directional continuity is not less than the preset directional continuity threshold and the reflection attenuation continuity is greater than the preset reflection continuity threshold, the corresponding candidate region is identified as a shallow crack defect. The candidate region is mapped to the forward registration image, and the center position coordinates of the candidate region and the defect contour composed of boundary pixels are output.
10. A leather surface defect identification system based on depth visual feature analysis, used to implement the leather surface defect identification method based on depth visual feature analysis as described in any one of claims 1-9, characterized in that, include: The image acquisition module acquires a forward illumination image, a first oblique polarization image, a second oblique polarization image, and a transport coded pulse of the leather to be inspected in the transport state. The image registration and residual generation module performs position registration on the three images according to the transmitted encoding pulse, and generates a directional reflection residual map based on the corresponding pixel differences between the first obliquely polarized image and the second obliquely polarized image. The deep feature parsing module inputs the forward illumination image and the directional reflection residual map into the deep visual feature parsing network, extracts the grain surface semantic features and reflection change features respectively, and performs channel weighting on the grain surface semantic features based on the reflection change features to obtain defect candidate features; The defect consistency feature generation module calculates the texture extension direction of the candidate region based on the defect candidate features, and determines the continuity of reflection attenuation of the candidate region at adjacent transport positions by combining the directional reflection residual map, thereby generating defect consistency features. The output module identifies the candidate region as a shallow crack defect when the texture extension direction of the candidate region is continuous and the reflection attenuation continuity is greater than a preset threshold, and outputs the location and outline of the shallow crack defect.