A method for saliency detection of computer digital images
By performing color space conversion and multi-scale analysis under RGB channels, the saliency detection algorithm is optimized, solving the accuracy problem of plastic material quality detection in traditional algorithms and realizing efficient detection of surface cracks in plastic materials.
Patent Information
- Application Number
- CN202510958846.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-07-11
AI Technical Summary
Traditional saliency detection CA algorithms lead to deviations in the calculation of pixel saliency values when performing saliency detection on images of plastic material surfaces, thus reducing the accuracy of plastic material quality detection.
By acquiring computer digital images in RGB channels, performing color space conversion to obtain brightness values, constructing multiple scales for target pixels, analyzing color and texture feature coefficients, and optimizing saliency calculation by combining isolation degree, the true saliency value is obtained to improve detection accuracy.
It improves the accuracy of detecting surface cracks in plastic materials, reduces the possibility of false detection and missed detection, and ensures the reliability of quality inspection.
Smart Images

Figure CN120833495B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing, and more specifically to a method for saliency detection of computer digital images. Background Technology
[0002] In the digital media era, abundant image data has brought great enjoyment to users. Computer digital images are an excellent carrier for the rapid dissemination of information. However, a large amount of image data contains a lot of invalid and redundant data, so it is necessary to accurately and quickly capture key and effective information from a large number of digital images.
[0003] In related technologies, the context-aware (CA) saliency detection algorithm is usually used to perform multi-scale saliency detection on pixels in the surface image of a target object and extract the difference regions in the image. However, due to the complex texture features of special object surfaces and the lack of obvious differences in their performance features, the traditional saliency detection CA algorithm can lead to deviations in the calculation results of pixel saliency values during the saliency detection process of surface images, resulting in poor accuracy in extracting key information. Summary of the Invention
[0004] To address the technical problem that traditional saliency detection (CA) algorithms for saliency detection of plastic material surface images can lead to deviations in the calculation of pixel saliency values, thereby reducing the accuracy of plastic material quality inspection results, this invention aims to provide a saliency detection method for computer digital images. The specific technical solution adopted is as follows:
[0005] This invention proposes a saliency detection method for computer digital images, the method comprising:
[0006] Acquire a computer digital image in RGB channels; convert the RGB image to a color space to obtain the brightness value of each pixel;
[0007] Take any pixel in the RGB image as the target pixel, and construct different scales of the target pixel starting from the target pixel. Each scale includes a different number of pixels in a preset direction. Based on the channel values and brightness values of the pixels in each scale, obtain the color feature coefficients of the target pixel at each scale. Based on the color feature coefficients of the target pixel at each scale, and the difference in brightness values between the target pixel and other pixels in each scale, obtain the texture feature coefficients of the target pixel at each scale.
[0008] Based on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image at the same scale, the isolation degree of the target pixel at each scale is obtained; saliency detection is performed on the RGB image to obtain the initial saliency value of the target pixel at each scale; the true saliency value of the target pixel is obtained by combining the initial saliency value of the target pixel at all scales and the isolation degree.
[0009] The quality of the plastic material is detected based on the true saliency value of each pixel.
[0010] Further, obtaining the color feature coefficients of the target pixel at each scale based on the channel values of the pixel at each scale and the brightness value includes:
[0011] The sum of the R channel value, G channel value, B channel value and the brightness value of each pixel in each scale of the target pixel is used as the color parameter of each pixel in each scale;
[0012] The sum of the color parameters of all pixels at each scale of the target pixel is used as the first feature parameter of the target pixel at each scale.
[0013] Combine any two channels from the R, G, and B channels to form a channel group; use the absolute value of the difference between the two channel values in each channel group as the initial channel value difference for each channel group.
[0014] The sum of the initial channel value differences of all channel groups of each pixel in each scale of the target pixel is used as the overall channel value difference of each pixel in each scale.
[0015] The sum of the overall channel value differences of all pixels at each scale of the target pixel is used as the second feature parameter of the target pixel at each scale;
[0016] Based on the first feature parameter and the second feature parameter, the color feature coefficients of the target pixel at each scale are obtained.
[0017] Further, obtaining the color feature coefficients of the target pixel at each scale based on the first feature parameter and the second feature parameter includes:
[0018] The product of the first feature parameter and the second feature parameter is negatively correlated and normalized to obtain the color feature coefficients of the target pixel at each scale.
[0019] Further, obtaining the texture feature coefficients of the target pixel at each scale based on the color feature coefficients of the target pixel at each scale, and the difference in brightness values between the target pixel and other pixels at each scale, includes:
[0020] At each scale of the target pixel, the absolute value of the difference in brightness value between each other pixel and the target pixel is used as the initial brightness value difference of each other pixel at each scale.
[0021] The sum of the initial brightness value differences of all other pixels in each scale of the target pixel is taken as the overall brightness value difference of the target pixel at each scale.
[0022] The product of the overall brightness difference of the target pixel at each scale and the color feature coefficient is used as the texture feature coefficient of the target pixel at each scale.
[0023] Further, obtaining the degree of isolation of the target pixel at each scale based on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image (excluding the target pixel) at the same scale includes:
[0024] Choose any scale as the target scale;
[0025] The absolute value of the difference between the color feature coefficients of each other pixel in the RGB image and the target pixel at the target scale is taken as the color feature difference of each other pixel in the RGB image at the target scale.
[0026] The cumulative value of the color feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the color difference index of the target pixel at the target scale.
[0027] The absolute value of the difference between the texture feature coefficients of each other pixel in the RGB image and the target pixel at the target scale is taken as the texture feature difference of each other pixel in the RGB image at the target scale.
[0028] The cumulative value of the texture feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the texture difference index of the target pixel at the target scale.
[0029] The product of the color difference index and the texture difference index is used as the degree of isolation of the target pixel at the target scale.
[0030] Furthermore, the step of performing saliency detection on the RGB image to obtain the initial saliency value of the target pixel at each scale includes:
[0031] Based on the saliency detection CA algorithm, saliency detection is performed on RGB images to obtain the initial saliency value of the target pixel at each scale.
[0032] Furthermore, obtaining the true saliency value of the target pixel by combining the initial saliency value of the target pixel at all scales and the degree of isolation includes:
[0033] The isolation level of the target pixel at each scale is normalized to obtain the adjustment weight of the target pixel at each scale;
[0034] The adjusted weights are used as the weights of the initial saliency values of the target pixel at the corresponding scale, and the initial saliency values of the target pixel at all scales are weighted and summed to obtain the true saliency value of the target pixel.
[0035] Furthermore, the quality detection of the plastic material based on the true saliency value of each pixel includes:
[0036] In an RGB image, the region consisting of pixels whose true significance value is greater than a preset significance threshold is defined as the crack region.
[0037] If cracked areas are present, the plastic material is of substandard quality.
[0038] Furthermore, the construction of different scales for the target pixel starting from the target pixel includes:
[0039] The target pixel is defined as the pixels included in the first scale of the target pixel.
[0040] Starting from the target pixel, along the preset direction, the m-1 pixels closest to the target pixel and the target pixel are taken as the pixels included in the m-th scale of the target pixel. The value of m is 2, 3, 4...M, where M is a preset scale threshold. The preset direction is the long edge direction of the plastic material in the RGB image.
[0041] Furthermore, the step of converting the RGB image to a color space to obtain the brightness value of each pixel includes:
[0042] Convert the RGB image to the Lab color space to obtain a Lab image;
[0043] The L component value of each pixel in the Lab image is used as the brightness value of the pixel at the same position in the RGB image.
[0044] The present invention has the following beneficial effects:
[0045] This invention addresses the complex surface texture of plastic materials and the presence of inconspicuous cracks. Traditional saliency detection (CA) algorithms for detecting saliency in plastic material surface images can lead to deviations in the calculation of pixel saliency values, thus reducing the accuracy of plastic material quality inspection results. Therefore, this invention first acquires a computer-generated digital image in RGB channels. Considering that the color of cracked areas on the plastic material surface is darker than normal areas (i.e., the brightness of pixels in cracked areas is lower), the RGB image can be converted to a color space to obtain the brightness value of each pixel. This facilitates subsequent analysis of pixel color features based on brightness values, thereby constructing the target pixel. Multiple scales are used, and target pixels can be analyzed at different scales in subsequent processing. This allows for better capture of saliency information in the image. Furthermore, the obtained color feature coefficients reflect the color characteristics of the target pixels at each scale. Considering that there will be color inhomogeneity in the crack area due to the different depths of the crack, and that the brightness values of each pixel in the crack area vary greatly, the obtained texture feature coefficients can reflect the texture characteristics of the target pixels at each scale. Then, the initial saliency value of the target pixels can be adjusted by obtaining the degree of isolation, so as to obtain a more accurate true saliency value of the pixels, thereby improving the accuracy of saliency detection of target object features in computer digital images. Attached Figure Description
[0046] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart of a saliency detection method for computer digital images provided in one embodiment of the present invention. Detailed Implementation
[0048] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a saliency detection method for computer digital images proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0050] The following description, in conjunction with the accompanying drawings, details a specific scheme for a saliency detection method for computer digital images provided by the present invention.
[0051] Please see Figure 1 The diagram illustrates a flowchart of a saliency detection method for computer digital images according to an embodiment of the present invention, the method comprising:
[0052] Step S1: Obtain the computer digital image in RGB channel; convert the RGB image to color space to obtain the brightness value of each pixel.
[0053] It should be noted that the surface texture roughness characteristics of different target objects vary. Therefore, the computer digital image obtained in the RGB channel of this embodiment is a surface image of plastic material.
[0054] Cracks and defects on the surface of plastic materials not only reduce the strength and toughness of the materials, but also lead to breakage or failure after prolonged use. Therefore, it is necessary to detect cracks and defects on the surface of plastic materials to ensure their quality. Related technologies typically use the context-aware (CA) saliency detection algorithm to perform multi-scale saliency detection on pixels in images of plastic material surfaces to achieve quality inspection. However, traditional CA algorithms usually use the average of the saliency values of pixels at different scales as the final saliency value. Since the texture features of plastic material surfaces are complex, the obtained saliency values at different scales may contain high or low outliers, leading to deviations in the calculation results of the final saliency value of pixels and reducing the accuracy of the quality inspection results. Therefore, this invention proposes a saliency detection method for computer digital images to solve this problem.
[0055] This invention uses a high-definition camera to capture images of the plastic material surface, obtaining raw images of the plastic material surface. The raw images are then filtered to reduce noise, thereby lowering the possibility of false or missed detections of cracks on the plastic material surface. Mean filtering can be used, but in other embodiments of this invention, median filtering or Gaussian filtering can also be used; no specific method is specified here. To avoid the influence of non-plastic material surface areas on quality inspection, this invention inputs the filtered raw image into a semantic segmentation neural network to extract a computer digital image containing only the RGB channels. Semantic segmentation neural networks are well-known techniques to those skilled in the art and will not be described in detail here.
[0056] Considering that the brightness of the cracked area on the surface of the plastic material is darker than that of the normal area, that is, the brightness of the pixels in the cracked area is smaller, the computer digital image containing only RGB channels can be first converted to color space to obtain the brightness value of each pixel in the RGB image. In the subsequent saliency detection process, the color features of the pixels can be analyzed based on the brightness value of the pixels, so as to better capture the saliency information in the RGB image.
[0057] Preferably, in one embodiment of the present invention, the method for obtaining the brightness value of each pixel specifically includes:
[0058] An RGB image is converted to the Lab color space to obtain a Lab image. The L component value in the Lab color space represents the brightness value of a pixel. Therefore, the L component value of each pixel in the Lab image can be used as the brightness value of the pixel at the same position in the RGB image. The color space conversion technique is a well-known technique in the art and will not be elaborated here.
[0059] In other embodiments of the present invention, RGB images may also be converted to other color spaces containing luminance components, such as HSV color space or HSL color space, without limitation.
[0060] Step S2: Take any pixel in the RGB image as the target pixel, and construct different scales of the target pixel starting from the target pixel. Each scale includes a different number of pixels in a preset direction. Based on the channel values and brightness values of the pixels in each scale, obtain the color feature coefficients of the target pixel at each scale. Based on the color feature coefficients of the target pixel at each scale, and the difference in brightness values between the target pixel and other pixels in each scale, obtain the texture feature coefficients of the target pixel at each scale.
[0061] In traditional saliency detection (CA) algorithms, multi-scale saliency detection is typically performed on pixels in RGB images. Multiple perceptrons at different scales are combined to calculate the final saliency value. This means the algorithm not only focuses on the features of individual pixels but also considers background information within a certain range around the pixel. Therefore, the size of the analyzed region or the number of pixels varies at different scales. Based on multi-scale analysis, image content can be analyzed and understood from different perspectives and ranges, improving the accuracy of crack extraction from plastic material surfaces. To facilitate subsequent analysis, this embodiment of the invention uses any pixel in the RGB image as the target pixel and constructs multiple different scales for the target pixel as the starting point. In subsequent analysis, the target pixel can be analyzed at different scales, better capturing the saliency information in the RGB image, thereby accurately extracting cracks from the plastic material surface and improving the accuracy of quality detection.
[0062] Preferably, in one embodiment of the present invention, the method for constructing target pixels at different scales specifically includes:
[0063] The target pixel is included in the first scale of the target pixel. Starting from the target pixel, along a preset direction, the m-1 pixels closest to the target pixel, along with the target pixel itself, are included in the m-th scale of the target pixel. The preset direction is set to the long edge direction of the plastic material in the RGB image. Since the RGB image is a two-dimensional planar image, while the actual plastic material is three-dimensional, the long edge direction of the plastic material in the RGB image is also the direction of the generatrix of the three-dimensional plastic material. The value of m is 2, 3, 4…M, where M is the preset scale threshold. The preset scale threshold is set to 10, meaning 10 different scales are constructed for the target pixel. The scale is defined, and different scales contain different numbers of pixels. For example, the first scale of the target pixel contains only the target pixel itself, the second scale contains the pixel closest to the target pixel and the target pixel, a total of two pixels, the third scale contains the two pixels closest to the target pixel and the target pixel, a total of three pixels, and so on. In the process of changing from the first scale to the last scale of the target pixel, the pixels in each scale show a trend of extending from the target pixel as the starting point along the long edge direction or generatrix direction of the plastic material. The preset scale threshold can also be set by the implementer according to the specific implementation scenario, and is not limited here.
[0064] Since different scales of the target pixel contain different numbers of pixels, the pixels at multiple scales of the target pixel can be analyzed to better extract the saliency information in the RGB image. Considering that the color of the crack area on the surface of the plastic material is black and the brightness of the crack area is dark, the channel values and brightness values of the pixels at each scale of the target pixel can be analyzed. The obtained color feature coefficients reflect the color characteristics of the target pixel at different scales, which facilitates more effective saliency detection based on the color feature coefficients, improves the accuracy of pixel saliency value calculation, and thus improves the accuracy of surface quality detection of plastic materials.
[0065] Preferably, in one embodiment of the present invention, the method for obtaining the color feature coefficients of the target pixel at each scale specifically includes:
[0066] Because the pixels in the crack region are predominantly black and dim, the sum of the R, G, B channel values and brightness values of each pixel at each scale can be used as the color parameter of each pixel at each scale. The cumulative value of the color parameters of all pixels at each scale can be used as the first feature parameter of the target pixel at each scale. Any combination of two channels from the R, G, and B channels can be used as a channel group. The absolute value of the difference between the two channel values in each channel group can be used as the initial channel value difference of each channel group. The cumulative value of the initial channel value differences of all channel groups of each pixel at each scale can be used as the overall channel value difference of each pixel at each scale. The cumulative value of the overall channel value difference of all pixels at each scale can be used as the second feature parameter of the target pixel at each scale. The product of the first and second feature parameters is negatively correlated and normalized to obtain the color feature coefficient of the target pixel at each scale. The expression for the color feature coefficient can be as follows:
[0067] sc m =exp(-F m ×F′ m )
[0068]
[0069] Among them, sc m F represents the color feature coefficient of the target pixel at the m-th scale; m F' represents the first feature parameter of the target pixel at the m-th scale; m R represents the second feature parameter of the labeled pixel at the m-th scale; (m,i) G (m,i) B (m,i)Let L represent the R-channel, G-channel, and B-channel values of the i-th pixel at the m-th scale of the target pixel; (m,i) I represents the brightness value of the i-th pixel in the m-th scale of the target pixel; m C represents the number of pixels in the m-th scale of the target pixel; (m,i,h) and C' (m,i,h) These represent the two channel values in the h-th channel group of the i-th pixel at the m-th scale of the target pixel; H represents the number of channel groups of the pixel. Since each pixel in an RGB image has three channels, the number of channel groups in pairs is H = 3; exp() represents an exponential function with the natural constant e as the base.
[0070] In the process of obtaining the color feature coefficients of the target pixel at each scale, the color feature coefficients sc m The larger the value of R, the closer the color feature of the target pixel at that scale is to the color of the crack on the surface of the plastic material. Compared to the normal area of the plastic material, the color of the surface crack is darker, so the channel values of the pixel are smaller, and the brightness of the crack is also darker, so the brightness value of the pixel is also smaller. Therefore, the color parameter R... (m,i) +G (m,i) +B (m,i) +L (m,i) The smaller the value and the closer it is to 0, the closer the color and brightness of the target pixel at that scale are to the crack features. Therefore, the first feature parameter F... m The smaller the value, the closer the color feature coefficient sc is to the crack at that scale. m The larger the initial channel difference |C, the greater it becomes. (m,i,h) -C' (m,i,h) The smaller the value, the closer the two channel values in the channel group are, and therefore the greater the overall channel value difference. The smaller the value, the closer the channel values of the pixel are, and thus the smaller the value of the second feature parameter F'. m The smaller the value, the closer the channel values of each pixel at that scale are. Combining the first and second feature parameters, the smaller both are, the greater the confidence that the channel values of the target pixel at that scale are small and close to 0. This further indicates that the color and brightness of the target pixel at that scale more closely resemble a crack. Therefore, the color feature coefficient sc... m The larger it is.
[0071] After obtaining the color feature coefficients of the target pixel at each scale, considering the uneven color within the crack area due to the varying depths of the crack, pixels in areas with shallower crack textures will exhibit smaller color feature coefficients at smaller scales, approaching those of pixels in normal areas of the plastic material surface. Using only color feature coefficients to calculate the isolation level of subsequent target pixels will introduce errors. Furthermore, the brightness differences among pixels in the crack area are significant. Therefore, it is necessary to analyze the differences in brightness values of the target pixel at each scale. Simultaneously, by combining the color feature coefficients of the target pixel at each scale, the texture feature coefficients of the target pixel at each scale are obtained. These texture feature coefficients further reflect the likelihood that the target pixel belongs to a crack area, facilitating a more accurate assessment of the target pixel's isolation level by combining the texture and color feature coefficients, and allowing for adjustments to the saliency values of the target pixel.
[0072] Preferably, in one embodiment of the present invention, the method for obtaining the texture feature coefficients of the target pixel at each scale specifically includes:
[0073] At each scale of the target pixel, the absolute value of the difference in brightness value between each other pixel and the target pixel is taken as the initial brightness value difference of each other pixel at each scale; the sum of the initial brightness value differences of all other pixels at each scale of the target pixel is taken as the overall brightness value difference of the target pixel at each scale; the product of the overall brightness value difference of the target pixel at each scale and the color feature coefficient is taken as the texture feature coefficient of the target pixel at each scale. The expression for the texture feature coefficient can be specifically as follows:
[0074]
[0075] Among them, wl m sc represents the texture feature coefficient of the target pixel at the m-th scale; m L represents the color feature coefficient of the target pixel at the m-th scale; (m,t) L represents the brightness value of the t-th pixel other than the target pixel in the m-th scale; o Indicates the brightness value of the target pixel; I m Let I represent the number of pixels at the m-th scale of the target pixel. m -1 represents the number of pixels other than the target pixel in the m-th scale.
[0076] In the process of obtaining the texture feature coefficients of the target pixel at each scale, similar to the color feature coefficients, the texture feature coefficients wlm The larger the value, the closer the texture of the target pixel at that scale is to the characteristics of a crack. When cracks appear on the surface of a plastic material, the texture of the crack usually exhibits varying depths, resulting in differences in the brightness values of each pixel in the crack area. Therefore, the initial brightness value difference |L (m,t) -L o The larger the value, the greater the difference in brightness between each other pixel and the target pixel at that scale, and therefore the greater the overall brightness difference. The larger the value, the greater the difference in brightness values among pixels at that scale, indicating that the texture representation at that scale is closer to the characteristics of a crack. Therefore, the texture feature coefficient wl... m The larger the value, the higher the color feature coefficient sc. m The larger the value, the greater the confidence that there are differences in the brightness values of pixels at that scale, and the higher the texture feature coefficient wl. m The larger it is.
[0077] After obtaining the color feature coefficients and texture feature coefficients of the target pixel through the above steps, the same method can be used to obtain the color feature coefficients and texture feature coefficients of other pixels in the RGB image at different scales, excluding the target pixel. In subsequent steps, the color feature coefficients and texture feature coefficients of each pixel can be further analyzed, thereby optimizing the saliency detection CA algorithm, reducing the deviation in the calculation of pixel saliency values, and thus improving the accuracy of plastic material quality detection.
[0078] Step S3: Based on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image at the same scale, obtain the isolation degree of the target pixel at each scale; perform saliency detection on the RGB image to obtain the initial saliency value of the target pixel at each scale; combine the initial saliency value and isolation degree of the target pixel at all scales to obtain the true saliency value of the target pixel.
[0079] Traditional saliency detection algorithms (CA) typically use the average of the saliency values of pixels at different scales as the final saliency value. However, the saliency values at different scales may contain high or low outliers, leading to deviations in the calculation of the final saliency value and reducing the accuracy of the plastic material quality detection results. Considering that the area of the crack region on the surface of the plastic material is smaller than that of the normal region, and that the feature characteristics of pixels in the crack region and the normal region differ significantly (i.e., the color feature coefficients and texture feature coefficients of pixels in the crack region and the normal region differ significantly at the same scale), further analysis can be performed on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image (excluding the target pixel) at the same scale. By obtaining the degree of isolation of the target pixel at different scales, subsequent saliency detection can be optimized and adjusted to reduce the calculation deviation of the final saliency value of the target pixel. It should be noted that since each pixel in the RGB image has different scales, and the number of pixels contained in different scales of each pixel is different, if two pixels contain the same number of pixels at the same scale, it means that the two pixels are the same scale.
[0080] Preferably, in one embodiment of the present invention, the method for obtaining the isolation degree of the target pixel at each scale specifically includes:
[0081] In one embodiment of the present invention, each pixel in the RGB image has 10 scales, with different numbers of pixels at different scales. One scale can be arbitrarily selected as the target scale, for example, the fifth scale containing 5 pixels can be selected as the target scale. The absolute value of the difference in color feature coefficients between each other pixel in the RGB image (excluding the target pixel) and the target pixel at the target scale is taken as the color feature difference of each other pixel in the RGB image at the target scale. The accumulated value of the color feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the color difference index of the target pixel at the target scale. The absolute value of the difference in texture feature coefficients between each other pixel in the RGB image (excluding the target pixel) and the target pixel at the target scale is taken as the texture feature difference of each other pixel in the RGB image at the target scale. The accumulated value of the texture feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the texture difference index of the target pixel at the target scale. The product of the color difference index and the texture difference index is taken as the isolation degree of the target pixel at the target scale. The expression for the degree of isolation can be specifically as follows:
[0082]
[0083] Among them, gl m Indicates the degree of isolation of the target pixel at the m-th scale; sc m sc represents the color feature coefficient of the target pixel at the m-th scale; (n,m) wl represents the color feature coefficient of the nth pixel (excluding the target pixel) in an RGB image at the m-th scale; m wl represents the texture feature coefficient of the target pixel at the m-th scale; (n,m) The denot represents the texture feature coefficient of the nth pixel other than the target pixel in the RGB image at the m-th scale; N represents the number of pixels in the RGB image, and N-1 represents the number of pixels other than the target pixel in the RGB image; norm() represents the normalization function.
[0084] In the process of obtaining the isolation degree of the target pixel at each scale, the isolation degree gl m Used for subsequent optimization and adjustment of significance detection results, isolation level gl m The larger the value, the more likely the target pixel at that scale is to exhibit features characteristic of a crack region, where the color feature difference |sc m -sc (n,m) The larger the value, the greater the difference in color feature coefficients between the target pixel and other pixels at the same scale. Since the number of pixels in the crack region is relatively small compared to the normal region, therefore... The larger the value, the greater the difference in color feature coefficients between the target pixel and other pixels at the same scale. Therefore, the color difference index... The larger the value, the closer the feature representation of the target pixel at that scale is to the crack feature, and the greater the isolation degree of the target pixel at that scale (gl). m The larger the value, the better; similarly, the greater the difference in texture index. The larger the value, the closer the feature representation of the target pixel at that scale is to the crack feature, and the greater the isolation degree of the target pixel at that scale (gl). m The larger it is.
[0085] In one embodiment of the present invention, the normalization process can be specifically, for example, maximum and minimum value normalization. Furthermore, the normalization in subsequent steps can all adopt maximum and minimum value normalization. In other embodiments of the present invention, other normalization methods can be selected according to the specific range of the numerical values, which will not be elaborated further.
[0086] This invention involves performing saliency detection on a computer digital image in the RGB channel to obtain the saliency values of pixels at different scales. Based on these saliency values, cracks on the surface of a plastic material are extracted, and the plastic material is then subjected to quality inspection. Therefore, further saliency detection is needed on the RGB image to obtain the initial saliency values of the target pixels at each scale. In one embodiment of this invention, the saliency detection CA algorithm can be used to perform saliency detection on the RGB image to obtain the initial saliency values of the target pixels at each scale. The saliency detection CA algorithm is a well-known technique and will not be described in detail here.
[0087] After obtaining the initial saliency values of the target pixels at each scale, the initial saliency values calculated using the traditional saliency detection CA algorithm have certain deviations. Therefore, further optimization and adjustment of the initial saliency values are needed. The degree of isolation reflects the difference in image features between the target pixel and other pixels at the same scale. The greater the degree of isolation at a certain scale, the more the image features of the target pixel at that scale match the image features of the crack area. Therefore, the initial saliency value at that scale should be given more reference value. Thus, the initial saliency values and isolation levels of the target pixels at all scales can be combined, and the initial saliency values can be adjusted using the degree of isolation at multiple scales to obtain more accurate true saliency values of the target pixels. This facilitates more effective detection of the quality of plastic materials based on the true saliency values.
[0088] Preferably, in one embodiment of the present invention, the method for obtaining the true saliency value of the target pixel specifically includes:
[0089] The isolation level of the target pixel at each scale is normalized to obtain the adjusted weight of the target pixel at each scale. This adjusted weight is then used as the weight of the initial saliency value of the target pixel at the corresponding scale. Finally, the initial saliency values of the target pixel at all scales are weighted and summed to obtain the true saliency value of the target pixel. The expression for the true saliency value can be, for example, as follows:
[0090]
[0091] Where S' represents the true saliency value of the target pixel; S m gl represents the initial saliency value of the target pixel at the m-th scale; m This indicates the degree of isolation of the target pixel at the m-th scale; gl j This indicates the degree of isolation of the target pixel at the j-th scale; M represents the number of all scales, and in one embodiment of the present invention, M = 10.
[0092] In obtaining the true significance value of a target pixel, the true significance value S' reflects the degree of crack characteristics exhibited by the target pixel at various scales. The larger the true significance value, the more the target pixel conforms to crack characteristics, meaning the target pixel is more likely to belong to a crack region. The weights are adjusted accordingly. Used to determine the initial significance value S at each scale m Weighted adjustments are made, among which Used for gl m When normalizing, the greater the adjustment weight of the target pixel at each scale, the more reference the initial saliency value at that scale should be given. Therefore, the initial saliency values of the target pixel at different scales can be weighted and summed by adjusting the weights to optimize the initial saliency values at different scales, thereby obtaining a more accurate true saliency value of the target pixel.
[0093] After obtaining the true saliency value of the target pixel, the true saliency values of other pixels in the RGB image can be obtained using the same method described above. Subsequently, the quality inspection of the plastic material surface can be achieved based on the true saliency values.
[0094] Step S4: Perform saliency detection on the computer digital image of the plastic material based on the true saliency value of each pixel.
[0095] The above steps can be used to obtain the true saliency value of each pixel in the RGB digital image. The larger the true saliency value of a pixel, the closer the characteristics of that pixel are to crack features at multiple scales. Therefore, the quality of plastic materials can be detected based on the true saliency value of each pixel in the RGB image.
[0096] Preferably, in one embodiment of the present invention, the method for detecting the quality of plastic materials specifically includes:
[0097] In an RGB image, the region consisting of pixels with a true saliency value greater than a preset saliency threshold is designated as a crack region. If a crack region exists, the quality of the plastic material is substandard, and the substandard plastic material can be destroyed to ensure the quality of the plastic material. The preset saliency threshold is set to 0.7, and the specific value of the preset saliency threshold can also be set by the implementer according to the specific implementation scenario, which is not limited here.
[0098] In summary, this embodiment of the invention first acquires a computer digital image in RGB channels and performs color space conversion on the RGB image to obtain the brightness value of each pixel; it then takes any pixel as the target pixel and constructs multiple scales for the target pixel. Based on the channel values and brightness values of the pixels in each scale, it obtains the color feature coefficients of the target pixel at each scale; based on the color feature coefficients of the target pixel at each scale, and the difference in brightness values between the target pixel and other pixels in each scale, it obtains the texture feature coefficients of the target pixel at each scale; based on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image at the same scale, it obtains the isolation degree of the target pixel at each scale; it performs saliency detection on the RGB image to obtain the initial saliency value of the target pixel at each scale; and by combining the initial saliency value and isolation degree of the target pixel at all scales, it obtains the true saliency value of the target pixel, and then performs saliency identification detection on abnormal areas of the plastic material based on the true saliency value of each pixel.
[0099] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0100] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for saliency detection of computer digital images, characterized in that, The method includes: Acquire an RGB image from a computer; convert the RGB image to a color space to obtain the brightness value of each pixel; Take any pixel in the RGB image as the target pixel, and construct different scales of the target pixel starting from the target pixel. Each scale includes a different number of pixels in a preset direction. Based on the channel values and brightness values of the pixels in each scale, obtain the color feature coefficients of the target pixel at each scale. Based on the color feature coefficients of the target pixel at each scale, and the difference in brightness values between the target pixel and other pixels in each scale, obtain the texture feature coefficients of the target pixel at each scale. Based on the differences in color feature coefficients and texture feature coefficients between the target pixel and other pixels in the RGB image at the same scale, the isolation degree of the target pixel at each scale is obtained; saliency detection is performed on the RGB image to obtain the initial saliency value of the target pixel at each scale; the true saliency value of the target pixel is obtained by combining the initial saliency value of the target pixel at all scales and the isolation degree. The quality of the plastic material is detected based on the true salient value of each pixel. Methods for obtaining the color feature coefficients of target pixels at each scale include: The sum of the R channel value, G channel value, B channel value and the brightness value of each pixel in each scale of the target pixel is used as the color parameter of each pixel in each scale; The sum of the color parameters of all pixels at each scale of the target pixel is used as the first feature parameter of the target pixel at each scale. Combine any two channels from the R, G, and B channels to form a channel group; use the absolute value of the difference between the two channel values in each channel group as the initial channel value difference for each channel group. The sum of the initial channel value differences of all channel groups of each pixel in each scale of the target pixel is used as the overall channel value difference of each pixel in each scale. The sum of the overall channel value differences of all pixels at each scale of the target pixel is used as the second feature parameter of the target pixel at each scale; Based on the first feature parameter and the second feature parameter, the color feature coefficients of the target pixel at each scale are obtained; Methods for obtaining the color feature coefficients of target pixels at each scale include: The product of the first feature parameter and the second feature parameter is negatively correlated and normalized to obtain the color feature coefficients of the target pixel at each scale. Methods for obtaining the texture feature coefficients of target pixels at each scale include: At each scale of the target pixel, the absolute value of the difference in brightness value between each other pixel and the target pixel is used as the initial brightness value difference of each other pixel at each scale. The sum of the initial brightness value differences of all other pixels in each scale of the target pixel is taken as the overall brightness value difference of the target pixel at each scale. The product of the overall brightness difference of the target pixel at each scale and the color feature coefficient is used as the texture feature coefficient of the target pixel at each scale. Methods for obtaining the isolation level of target pixels at each scale include: Choose any scale as the target scale; The absolute value of the difference between the color feature coefficients of each other pixel in the RGB image and the target pixel at the target scale is taken as the color feature difference of each other pixel in the RGB image at the target scale. The cumulative value of the color feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the color difference index of the target pixel at the target scale. The absolute value of the difference between the texture feature coefficients of each other pixel in the RGB image and the target pixel at the target scale is taken as the texture feature difference of each other pixel in the RGB image at the target scale. The cumulative value of the texture feature differences of all other pixels in the RGB image at the target scale is normalized to obtain the texture difference index of the target pixel at the target scale. The product of the color difference index and the texture difference index is used as the degree of isolation of the target pixel at the target scale. Methods for obtaining the initial saliency value of the target pixel at each scale include: Based on the saliency detection CA algorithm, saliency detection is performed on RGB images to obtain the initial saliency value of the target pixel at each scale; Methods for obtaining the true saliency value of a target pixel include: The isolation level of the target pixel at each scale is normalized to obtain the adjustment weight of the target pixel at each scale; The adjusted weights are used as the weights of the initial saliency values of the target pixel at the corresponding scale, and the initial saliency values of the target pixel at all scales are weighted and summed to obtain the true saliency value of the target pixel.
2. The saliency detection method for computer digital images according to claim 1, characterized in that, The quality detection of plastic materials based on the true saliency value of each pixel includes: In an RGB image, the region consisting of pixels whose true significance value is greater than a preset significance threshold is defined as the crack region. If cracked areas are present, the plastic material is of substandard quality.
3. The saliency detection method for computer digital images according to claim 1, characterized in that, The construction of different scales of the target pixel starting from the target pixel includes: The target pixel is defined as the pixels included in the first scale of the target pixel. Starting from the target pixel, along the preset direction, find the pixel closest to the target pixel. The nth pixel and the target pixel are used as the nth pixel of the target pixel. The number of pixels contained in each scale. The value is ,in The preset scale threshold is the long edge direction of the plastic material in the RGB image.
4. The saliency detection method for computer digital images according to claim 1, characterized in that, The step of converting the RGB image to a color space to obtain the brightness value of each pixel includes: Convert the RGB image to the Lab color space to obtain a Lab image; The L component value of each pixel in the Lab image is used as the brightness value of the pixel at the same position in the RGB image.
Citation Information
Patent Citations
OLED mobile phone screen pixel positioning method and system based on region growth
CN118587291A
Aluminum material surface defect detection method for enhancing multi-scale feature extraction and target detection
CN118799268A