Saliency detection method for computer digital image
By performing color space conversion and multi-scale analysis under the RGB channel and optimizing the saliency detection algorithm, the problem of insufficient accuracy in plastic material detection in traditional algorithms is solved, and efficient detection of cracks on the surface of plastic materials is achieved.
Patent Information
- Application Number
- CN202510958846.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-07-11
AI Technical Summary
Traditional saliency detection (CA) algorithms lead to deviations in the calculation results of pixel saliency values when performing saliency detection on plastic material surface images, thus reducing the accuracy of plastic material quality detection.
By acquiring computer digital images under RGB channels, performing color space conversion to obtain brightness values, constructing multiple scales of target pixels, analyzing color and texture feature coefficients, and optimizing saliency value calculation based on isolation degree, the true saliency value is obtained to improve detection accuracy.
The accuracy of detecting cracks on the surface of plastic materials is improved, the possibility of false detection and missed detection is reduced, and the reliability of quality detection is ensured.
Smart Images

Figure CN120833495A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image data processing, and particularly to a computer digital image saliency detection method. BACKGROUND
[0002] In the digital media era, abundant image data brings great enjoyment to users, and computer digital images are excellent carriers for rapid information dissemination, but a large amount of image data information contains a large amount of invalid redundant data, and it is necessary to accurately and quickly capture key effective information from a large amount of digital images.
[0003] In the related art, a saliency detection CA algorithm (Context-Aware, CA) is usually used to perform multi-scale saliency detection on pixel points in a surface image of a target object, and to extract a difference region in the image, but due to the fact that the texture features of the surface of the special object are relatively complex and the performance feature difference is not obvious, in the process of performing saliency detection on the surface image by using the traditional saliency detection CA algorithm, the calculation result of the saliency value of the pixel points will deviate, thereby the accuracy of key information extraction is poor. SUMMARY
[0004] In order to solve the technical problem that in the process of performing saliency detection on a surface image of a plastic material by using the traditional saliency detection CA algorithm, the calculation result of the saliency value of the pixel points deviates, thereby reducing the accuracy of the quality detection result of the plastic material, the purpose of the present application is to provide a computer digital image saliency detection method, and the technical scheme adopted is as follows:
[0005] The present application provides a computer digital image saliency detection method, which comprises the following steps:
[0006] An RGB channel computer digital image is acquired, and the RGB image is subjected to color space conversion to obtain the brightness value of each pixel point.
[0007] Any one pixel point in the RGB image is taken as a target pixel point, and different scales of the target pixel point are constructed with the target pixel point as a starting point, wherein the different scales include different numbers of pixel points in a preset direction; color feature coefficients of the target pixel point in each scale are obtained according to the channel values and the brightness value of the pixel points in each scale of the target pixel point; and texture feature coefficients of the target pixel point in each scale are obtained according to the color feature coefficients of the target pixel point in each scale and the difference in brightness value between the target pixel point and other pixel points except the target pixel point in each scale.
[0008] According to the difference of the color feature coefficient and the difference of the texture feature coefficient between the target pixel point and other pixel points in the RGB image except the target pixel point under the same scale, the isolation degree of the target pixel point under each scale is obtained; the saliency detection is performed on the RGB image to obtain the initial saliency value of the target pixel point under each scale; and the real saliency value of the target pixel point is obtained by combining the initial saliency value and the isolation degree of the target pixel point under all scales.
[0009] The quality of the plastic material is detected based on the real saliency value of each pixel point.
[0010] Further, the color feature coefficient of the target pixel point under each scale is obtained according to the channel value and the brightness value of each pixel point in each scale of the target pixel point, and the color feature coefficient of the target pixel point under each scale is obtained according to the first feature parameter and the second feature parameter.
[0011] The sum value of the R channel value, the G channel value, the B channel value and the brightness value of each pixel point in each scale of the target pixel point is taken as the color parameter of each pixel point in each scale.
[0012] The accumulated value of the color parameters of all pixel points in each scale of the target pixel point is taken as the first feature parameter of the target pixel point under each scale.
[0013] The combination of any two channels of the R channel, the G channel and the B channel is taken as a channel group, and the absolute value of the difference value of the two channel values in each channel group is taken as the initial channel value difference of each channel group.
[0014] The accumulated value of the initial channel value differences of all channel groups of each pixel point in each scale of the target pixel point is taken as the overall channel value difference of each pixel point in each scale.
[0015] The accumulated value of the overall channel value differences of all pixel points in each scale of the target pixel point is taken as the second feature parameter of the target pixel point under each scale.
[0016] The color feature coefficient of the target pixel point under each scale is obtained according to the first feature parameter and the second feature parameter.
[0017] Further, the color feature coefficient of the target pixel point under each scale is obtained according to the first feature parameter and the second feature parameter.
[0018] The product value of the first feature parameter and the second feature parameter is negatively correlated and normalized to obtain the color feature coefficient of the target pixel point under each scale.
[0019] Further, the obtaining the texture feature coefficient of the target pixel point in each scale according to the color feature coefficient of the target pixel point in each scale and the difference in luminance value between the target pixel point and other pixel points in each scale comprises:
[0020] In each scale of the target pixel point, taking the absolute value of the difference in luminance value between each other pixel point and the target pixel point as the initial difference in luminance value of each other pixel point in each scale;
[0021] Taking the cumulative value of the initial difference in luminance value of all other pixel points in each scale of the target pixel point as the overall difference in luminance value of the target pixel point in each scale;
[0022] Taking the product value of the overall difference in luminance value and the color feature coefficient of the target pixel point in each scale as the texture feature coefficient of the target pixel point in each scale.
[0023] Further, the obtaining the isolation degree of the target pixel point in each scale according to the difference in color feature coefficient and the difference in texture feature coefficient between the target pixel point and other pixel points in the same scale comprises:
[0024] Arbitrarily selecting one scale as a target scale;
[0025] Taking the absolute value of the difference in color feature coefficient between each other pixel point and the target pixel point in the target scale as the color feature difference of each other pixel point in the target scale;
[0026] Normalizing the cumulative value of the color feature difference of all other pixel points in the target scale to obtain a color difference index of the target pixel point in the target scale;
[0027] Taking the absolute value of the difference in texture feature coefficient between each other pixel point and the target pixel point in the target scale as the texture feature difference of each other pixel point in the target scale;
[0028] Normalizing the cumulative value of the texture feature difference of all other pixel points in the target scale to obtain a texture difference index of the target pixel point in the target scale;
[0029] Taking the product value of the color difference index and the texture difference index as the isolation degree of the target pixel point in the target scale.
[0030] Further, the significant detection on the RGB image to obtain the initial significant value of the target pixel point at each scale includes:
[0031] The significant detection on the RGB image to obtain the initial significant value of the target pixel point at each scale includes:
[0032] Further, the combination of the initial significant value of the target pixel point at all scales and the isolation degree to obtain the real significant value of the target pixel point includes:
[0033] The isolation degree of the target pixel point at each scale is normalized to obtain the adjustment weight of the target pixel point at each scale.
[0034] The adjustment weight is taken as the weight of the initial significant value of the target pixel point at the corresponding scale, and the initial significant values of the target pixel point at all scales are weighted and summed to obtain the real significant value of the target pixel point.
[0035] Further, the quality of the plastic material is detected based on the real significant value of each pixel point.
[0036] In the RGB image, the region composed of the pixel points with the real significant value greater than the preset significant threshold is taken as a crack region.
[0037] If the crack region exists, the quality of the plastic material is unqualified.
[0038] Further, the different scales of the target pixel point are constructed with the target pixel point as the starting point.
[0039] The target pixel point is taken as the pixel point contained in the first scale of the target pixel point.
[0040] With the target pixel point as the starting point, the m-1 pixel points closest to the target pixel point and the target pixel point are taken as the pixel points contained in the mth scale of the target pixel point along the preset direction, and m is 2, 3, 4…M, wherein M is a preset scale threshold, and the preset direction is the long edge direction of the plastic material in the RGB image.
[0041] Further, the color space conversion of the RGB image to obtain the brightness value of each pixel point includes:
[0042] The RGB image is converted into the Lab color space to obtain a Lab image.
[0043] The L component value of each pixel point in the Lab image is taken as the brightness value of the pixel point at the same position in the RGB image.
[0044] The present application has the following advantages:
[0045] The present application considers that the surface texture feature of the plastic material is relatively complex and part of the crack is not obvious, and the traditional saliency detection CA algorithm will cause deviation of the calculation result of the pixel point saliency value in the process of saliency detection of the plastic material surface image, thereby reducing the accuracy of the plastic material quality detection result, therefore, the present application firstly acquires the computer digital image under the RGB channel, considers that the color of the crack region of the plastic material surface is relatively dark compared with the normal region, that is, the brightness of the pixel point in the crack region is small, therefore, the color space conversion can be performed on the RGB image to obtain the brightness value of each pixel point, which is convenient for subsequent analysis of the color feature of the pixel point based on the brightness value, and then a plurality of scales of the target pixel point are constructed, and the target pixel point can be analyzed under different scales in the subsequent process, which can better capture the saliency information in the image, and then the color feature coefficient is acquired to reflect the color feature of the target pixel point under each scale, and the color is not uniform in the crack region due to the different crack depth, and the difference of the brightness value of each pixel point in the crack region is large, therefore, the texture feature coefficient is acquired to reflect the texture feature of the target pixel point under each scale, and then the initial saliency value of the target pixel point is adjusted through the acquired isolation degree to obtain a more accurate real saliency value of the pixel point, thereby improving the accuracy of the saliency detection of the computer digital image target object feature. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, and the advantages thereof, below, a brief introduction will be given to the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only show some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0047] Figure 1 A flow chart of a saliency detection method of a computer digital image provided by an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, below, the specific implementation, structure, features and effects of the saliency detection method of a computer digital image according to the present application will be described in detail in combination with the drawings and the preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the 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 application belongs.
[0050] The specific scheme of the saliency detection method of the computer digital image provided by the present application will be specifically described below in combination with the drawings.
[0051] Please refer to Figure 1 which shows a flow chart of a saliency detection method of a computer digital image provided by an embodiment of the present application, and the method comprises:
[0052] Step S1: Obtain a computer digital image under an RGB channel; perform color space conversion on the RGB image to obtain the brightness value of each pixel point.
[0053] It should be noted that the surface texture roughness features of different target objects are different, so the computer digital image under the RGB channel obtained in this embodiment is a plastic material surface image.
[0054] The crack defects on the surface of the plastic material not only reduce the strength and toughness of the plastic material, but also cause the plastic material to break or fail after long-term use, so it is necessary to detect the crack defects on the surface of the plastic material to ensure the quality of the plastic material. In the related art, a saliency detection CA algorithm (Context-Aware, CA) is usually used to perform multi-scale saliency detection on the pixel points in the plastic material surface image to realize quality detection of the plastic material. However, the traditional saliency detection CA algorithm usually takes the average value of the saliency values of the pixel points at different scales as the final saliency value of the pixel points. However, the texture features of the plastic material surface are complex, and the saliency values at different scales may have high or low abnormal values, which may cause deviation in the calculation result of the final saliency value of the pixel points, thereby reducing the accuracy of the quality detection result of the plastic material. Therefore, the present embodiment proposes a saliency detection method of a computer digital image to solve the problem.
[0055] In the present embodiment, a high-definition camera is used to capture the surface of the plastic material, collect the original image of the surface of the plastic material, and perform filtering processing on the collected original image to reduce the noise in the original image, thereby reducing the possibility of false detection and missed detection of the crack on the surface of the plastic material. The filtering processing method can use mean filtering, and in other embodiments of the present application, median filtering or Gaussian filtering can also be used, which is not limited here. In order to avoid the influence of the non-plastic material surface area on the quality detection, the present embodiment inputs the original image after filtering processing into a semantic segmentation neural network, thereby extracting only the computer digital image under the RGB channel. The semantic segmentation neural network is a well-known technical means in the art, and will not be described here.
[0056] Considering that the brightness of the crack area of the plastic material surface is darker than that of the normal area, i.e. the brightness of the pixel point in the crack area is smaller, the computer digital image containing only the RGB channel can be first converted in color space, so as to obtain the brightness value of each pixel point in the RGB image. In the subsequent saliency detection process, the color feature of the pixel point can be analyzed based on the brightness value of the pixel point, so that the saliency information in the RGB image can be better captured.
[0057] Preferably, in one embodiment of the present application, the method for obtaining the brightness value of each pixel point specifically comprises:
[0058] The RGB image is converted into Lab color space to obtain a Lab image; wherein the L component value of the Lab color space represents the brightness value of the pixel point, so that the L component value of each pixel point in the Lab image can be taken as the brightness value of the pixel point at the same position in the RGB image. The color space conversion technology of the image is a technology well known to those skilled in the art, and will not be described here.
[0059] In other embodiments of the present application, the RGB image can also be converted into other color spaces containing a brightness component, such as HSV color space or HSL color space, which are not limited herein.
[0060] Step S2: any one pixel point in the RGB image is taken as a target pixel point, and different scales of the target pixel point are constructed with the target pixel point as the starting point, wherein different scales include different numbers of pixel points in a preset direction; color feature coefficients of the target pixel point in each scale are obtained according to the channel values and brightness values of the pixel points in each scale of the target pixel point; and texture feature coefficients of the target pixel point in each scale are obtained according to the color feature coefficients of the target pixel point in each scale and the difference in brightness values between the target pixel point and other pixel points except the target pixel point in each scale.
[0061] In the traditional saliency detection CA algorithm, the pixel points in the RGB image are usually subjected to multi-scale saliency detection, and a plurality of different scale perception units are combined to calculate the final saliency value, which means that the algorithm will not only pay attention to the features of a single pixel point, but also consider the background information within a certain range around the pixel point. Therefore, the size of the area range or the number of pixel points analyzed under different scales is different, and based on the analysis of multiple scales, the image content can be analyzed and understood from different perspectives and ranges, thereby improving the accuracy of the extraction of the surface cracks of the plastic material. In order to facilitate the analysis of the subsequent steps, the embodiments of the present application take any one pixel point in the RGB image as a target pixel point, and simultaneously construct a plurality of different scales of the target pixel point with the target pixel point as the starting point. In the subsequent steps, the target pixel point can be analyzed under different scales, which can better capture the saliency information in the RGB image, so as to accurately extract the surface cracks of the plastic material and improve the accuracy of quality detection.
[0062] Preferably, in one embodiment of the present application, the method for constructing different scales of the target pixel point specifically comprises:
[0063] The target pixel point is taken as a pixel point contained in the first scale of the target pixel point; the target pixel point is taken as the starting point, and the m-1 pixel points closest to the target pixel point and the target pixel point are taken as the pixel points contained in the mth scale of the target pixel point along the preset direction, wherein the preset direction is set as the long edge direction of the plastic material in the RGB image. Since the RGB image is a two-dimensional plane image, and 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, wherein M is a preset scale threshold, and the preset scale threshold is set as 10, that is, 10 different scales are constructed for the target pixel point, and different scales contain different numbers of pixel points. For example, the first scale of the target pixel point contains only one pixel point of the target pixel point itself, the second scale contains one pixel point closest to the target pixel point and the target pixel point, a total of two pixel points, the third scale contains two pixel points closest to the target pixel point and the target pixel point, a total of three pixel points, and so on. In the change process from the first scale to the last scale of the target pixel point, the pixel points in each scale show a trend of extending along the long edge direction or the generatrix direction of the plastic material with the target pixel point as the starting point. The preset scale threshold can also be set by the implementer according to the specific implementation scene, which is not limited herein.
[0064] Since the target pixel contains different numbers of pixels at different scales, the pixel 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 pixel at each scale of the target pixel can be analyzed. The color feature coefficient obtained reflects the color features of the target pixel at different scales, which facilitates subsequent more effective saliency detection based on the color feature coefficient, improves the accuracy of pixel saliency value calculation, and thus improves the accuracy of plastic material surface quality detection.
[0065] Preferably, in one embodiment of the present invention, the method for obtaining the color characteristic coefficient of the target pixel at each scale specifically includes:
[0066] Due to the characteristics that the color of the pixels in the crack area is black and the brightness is dark, the sum of the R channel value, G channel value, B channel value and brightness value of each pixel in each scale of the target pixel can be used as the color parameter of each pixel in each scale; the cumulative value of the color parameters of all pixels in each scale of the target pixel is used as the first characteristic parameter of the target pixel at each scale; the combination of any two channels in the R channel, G channel and B channel is used as a channel group; the absolute value of the difference between the two channel values in each channel group is used as the initial channel value difference of each channel group; the cumulative value of the initial channel value difference 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 cumulative value of the overall channel value difference of all pixels in each scale of the target pixel is used as the second characteristic parameter of the target pixel at each scale; the product value of the first characteristic parameter and the second characteristic parameter is normalized to be negatively correlated to obtain the color characteristic coefficient of the target pixel at each scale. The expression of the color characteristic coefficient can be specifically, for example, as follows:
[0067] sc m =exp(-F m ×F′ m )
[0068]
[0069] Among them, sc m Indicates the color feature coefficient of the target pixel at the mth scale; F m Represents the first characteristic parameter of the target pixel at the mth scale; F' m Represents the second characteristic parameter of the pixel at the mth scale; R (m,i) ,G (m,i) ,B (m,i)They represent the R channel value, G channel value, and B channel value of the i-th pixel in the m-th scale of the target pixel respectively; L (m,i) Represents the brightness value of the i-th pixel in the m-th scale of the target pixel; I m Represents the number of pixels in the mth scale of the target pixel; C (m,i,h) and C' (m,i,h) They respectively represent the two channel values in the h-th channel group of the ith pixel in the m-th scale of the target pixel; H represents the number of channel groups of the pixel. Since each pixel of the RGB image has three channels, the number of channel groups combined in pairs is H=3; exp() represents the exponential function with the natural constant e as the base.
[0070] In the process of obtaining the color feature coefficient of the target pixel at each scale, the color feature coefficient sc m The larger the value is, the closer the color feature of the target pixel at this scale is to the color of the crack on the surface of the plastic material. Compared with the normal area of the plastic material, the color of the surface crack is black. At this time, the channel values of the pixel are small, and the brightness of the crack is dark. At this time, the brightness value of the pixel is also small, so the color parameter R (m,i) +G (m,i) +B (m,i) +L (m,i) The smaller and closer to 0, the closer the color and brightness of the target pixel in this scale are to the crack characteristics. Therefore, the first characteristic parameter F m The smaller it is, the closer the color characteristics of the target pixel at this scale are to the crack, and the color characteristic coefficient sc m The larger the initial channel difference |C (m,i,h) -C' (m,i,h) The smaller the |, the closer the two channel values in the channel group are, so the overall channel value difference The smaller it is, the closer the channel values of the pixel points are, and the second characteristic parameter F' m The smaller it is, the closer the channel values of each pixel point at the target pixel point at this scale are. Combined with the first characteristic parameter and the second characteristic parameter, the smaller they are, the smaller the channel values of the pixel points at the target pixel point at this scale are, and the greater the credibility is, which further indicates that the color, that is, the brightness, of the target pixel point at this scale is closer to the crack. The color characteristic coefficient sc m The bigger it is.
[0071] After obtaining the color feature coefficients of the target pixel point at each scale, considering that the color in the crack region is not uniform due to the different depths of the cracks, the color feature coefficients of the pixel points in the area with shallow crack texture at a smaller scale are also smaller and close to the color feature coefficients of the pixel points in the normal area of the plastic material surface. If only the color feature coefficients are used to calculate the isolation degree of the subsequent target pixel point, there will be certain errors. In addition, the luminance of the pixel points in the crack region is quite different, so it is necessary to analyze the difference of the luminance of the pixel points at each scale of the target pixel point, and combine the color feature coefficients at each scale of the target pixel point to obtain the texture feature coefficients at each scale of the target pixel point. The texture feature coefficients can further reflect the possibility that the target pixel point belongs to the crack region, so as to facilitate the subsequent adjustment of the saliency value of the target pixel point by combining the texture feature coefficients and the color feature coefficients to obtain a more accurate isolation degree of the target pixel point.
[0072] Preferably, in one embodiment of the present application, the method for obtaining the texture feature coefficients of the target pixel point at each scale specifically comprises:
[0073] In each scale of the target pixel point, the absolute value of the difference between the luminance value of each other pixel point except the target pixel point and the target pixel point is taken as the initial luminance value difference of each other pixel point in each scale. The cumulative value of the initial luminance value differences of all other pixel points in each scale of the target pixel point is taken as the overall luminance value difference of the target pixel point at each scale. The product value of the overall luminance value difference and the color feature coefficient of the target pixel point at each scale is taken as the texture feature coefficient of the target pixel point at each scale. The expression of the texture feature coefficient can be specifically, for example:
[0074]
[0075] wherein, wl m represents the texture feature coefficient of the target pixel point at the mth scale; sc m represents the color feature coefficient of the target pixel point at the mth scale; L (m,t) represents the luminance value of the tth other pixel point except the target pixel point in the mth scale of the target pixel point; L o represents the luminance value of the target pixel point; I m represents the number of pixel points in the mth scale of the target pixel point, then I m -1 represents the number of other pixel points except the target pixel point in the mth scale of the target pixel point.
[0076] In the process of obtaining the texture feature coefficients of the target pixel point at each scale, similar to the color feature coefficients, the texture feature coefficients wlm The greater, the closer the texture performance of the target pixel point in the scale to the characteristics of the crack; when the crack appears on the surface of the plastic material, the texture of the crack usually shows the characteristics of different depths, so there is a certain difference in the brightness values of the pixel points in the crack area, so the initial brightness value difference |L (m,t) -L o The greater, the greater the difference between the brightness values of each other pixel point and the target pixel point in the scale, so the overall brightness value difference The greater, the greater the difference in the brightness values of the pixel points in the scale, and the closer the texture performance in the scale to the characteristics of the crack, so the texture feature coefficient wl m The greater, the greater the color feature coefficient sc m The greater, the greater the reliability of the difference in the brightness values of the pixel points in the scale, so the texture feature coefficient wl m The greater, the greater.
[0077] After obtaining the color feature coefficient and the texture feature coefficient of the target pixel point through the above steps, the color feature coefficient and the texture feature coefficient of each pixel point other than the target pixel point in the RGB image in different scales can be obtained using the same method. In the subsequent step, the color feature coefficient and the texture feature coefficient of each pixel point can be further analyzed, so as to realize the optimization of the saliency detection CA algorithm, reduce the deviation of the pixel point saliency value calculation, and further improve the accuracy of the plastic material quality detection.
[0078] Step S3: According to the difference in the color feature coefficient and the difference in the texture feature coefficient between the target pixel point and each pixel point other than the target pixel point in the RGB image in the same scale, the isolation degree of the target pixel point in each scale is obtained; the saliency of the RGB image is detected to obtain the initial saliency value of the target pixel point in each scale; and the real saliency value of the target pixel point is obtained by combining the initial saliency value and the isolation degree of the target pixel point in all scales.
[0079] The traditional saliency detection CA algorithm usually takes the average value of the saliency values of a pixel point at different scales as the final saliency value of the pixel point, and the saliency values at different scales may have higher or lower outliers, which may cause deviation in the calculation result of the final saliency value of the pixel point, thereby reducing the accuracy of the plastic material quality detection result. Considering that the area of the crack region on the surface of the plastic material is relatively small compared with the normal region, and the characteristics of the pixel points in the crack region and the normal region are quite different, that is, the color feature coefficients and the texture feature coefficients of the pixel points in the crack region and the normal region at the same scale are quite different, the color feature coefficient difference and the texture feature coefficient difference between the target pixel point and other pixel points in the RGB image except the target pixel point at the same scale can be further analyzed, the isolation degree of the target pixel point at different scales is obtained, and the subsequent saliency detection is optimized and adjusted, so as to reduce the calculation deviation of the final saliency value of the target pixel point. It should be noted that since each pixel point in the RGB image has different scales, and the number of pixel points included in each scale of each pixel point is different, if the number of pixel points included in the scales of two pixel points is the same, it means that the scales of the two pixel points are the same.
[0080] Preferably, in one embodiment of the present application, the method for obtaining the isolation degree of the target pixel point at each scale specifically comprises:
[0081] In one embodiment of the present application, each pixel point in the RGB image has 10 scales, and the number of pixel points in different scales is different. First, a scale can be arbitrarily selected as a target scale, for example, the fifth scale containing 5 pixel points can be selected as the target scale. The absolute value of the difference between the color feature coefficient of each other pixel point in the RGB image except the target pixel point and the target pixel point at the target scale is taken as the color feature difference of each other pixel point in the RGB image at the target scale. The cumulative value of the color feature differences of all other pixel points in the RGB image at the target scale is normalized to obtain the color difference index of the target pixel point at the target scale. The absolute value of the difference between the texture feature coefficient of each other pixel point in the RGB image except the target pixel point and the target pixel point at the target scale is taken as the texture feature difference of each other pixel point in the RGB image at the target scale. The cumulative value of the texture feature differences of all other pixel points in the RGB image at the target scale is normalized to obtain the texture difference index of the target pixel point at the target scale. The product value of the color difference index and the texture difference index is taken as the isolation degree of the target pixel point at the target scale. The expression of the isolation degree can be specifically, for example:
[0082]
[0083] wherein, gl m represents the isolation degree of the target pixel point at the mth scale; sc m represents the color feature coefficient of the target pixel point at the mth scale; sc (n,m) represents the color feature coefficient of the nth other pixel point except the target pixel point in the RGB image at the mth scale; wl m represents the texture feature coefficient of the target pixel point at the mth scale; wl (n,m) represents the texture feature coefficient of the nth other pixel point except the target pixel point in the RGB image at the mth scale; N represents the number of pixel points in the RGB image, and N-1 represents the number of other pixel points except the target pixel point in the RGB image; norm() represents a normalization function.
[0084] In the process of obtaining the isolation degree gl m for subsequent optimization and adjustment of the saliency detection result, the isolation degree gl m is greater, it means that the feature of the target pixel point at this scale is more likely to be a crack region, wherein the color feature difference |sc m -sc (n,m) is greater, it means that the difference between the color feature coefficients of the target pixel point and other pixel points at the same scale is greater, and since the number of pixel points in the crack region is less than that in the normal region, the color feature difference is greater, it means that the difference between the color feature coefficients of the target pixel point and other pixel points at the same scale is greater, and since the number of pixel points in the crack region is less than that in the normal region, the color feature difference is greater, it means that the feature of the target pixel point at this scale is closer to the crack feature, and the isolation degree gl m of the target pixel point at this scale is greater, and for the same reason, the texture difference index is greater, it also means that the feature of the target pixel point at this scale is closer to the crack feature, and the isolation degree gl m of the target pixel point at this scale is greater.
[0085] In an embodiment of the present application, the normalization process can be specifically, for example, a max-min normalization process, and the normalization in the subsequent steps can also adopt the max-min normalization process, and in other embodiments of the present application, other normalization methods can be selected according to the specific range of values, which will not be described here.
[0086] The embodiment of the present application is to detect the saliency of the computer digital image under the RGB channel, obtain the saliency value of the pixel point under different scales, extract the crack on the surface of the plastic material based on the saliency value, and detect the quality of the plastic material, so it is necessary to further detect the saliency of the RGB image and obtain the initial saliency value of the target pixel point under each scale. In an embodiment of the present application, the saliency of the RGB image can be detected based on the saliency detection CA algorithm, so as to obtain the initial saliency value of the target pixel point under each scale. The saliency detection CA algorithm is a technical means familiar to those skilled in the art, and will not be described here.
[0087] After obtaining the initial saliency value of the target pixel point under each scale, since there is a certain deviation in the initial saliency value calculated by the traditional saliency detection CA algorithm, it is necessary to further optimize and adjust the initial saliency value. The isolation degree reflects the difference of the image features of the target pixel point and other pixel points under the same scale. The greater the isolation degree under a certain scale, the more the image features of the target pixel point under the scale conform to the image features of the crack region, so the initial saliency value under the scale should be given more reference. Therefore, the initial saliency value can be adjusted by using the isolation degree under multiple scales in combination with the initial saliency value and the isolation degree of the target pixel point under all scales, so as to obtain more accurate real saliency value of the target pixel point, which is convenient for subsequent more effective detection of the quality of the plastic material based on the real saliency value.
[0088] Preferably, in an embodiment of the present application, the method for obtaining the real saliency value of the target pixel point specifically comprises:
[0089] The isolation degree of the target pixel point under each scale is normalized to obtain the adjustment weight of the target pixel point under each scale. The adjustment weight is taken as the weight value of the initial saliency value of the target pixel point under the corresponding scale, and the initial saliency values of the target pixel point under all scales are weighted and summed to obtain the real saliency value of the target pixel point. The expression of the real saliency value can be specifically, for example:
[0090]
[0091] Wherein, S' represents the real saliency value of the target pixel point; S m represents the initial saliency value of the target pixel point under the mth scale; gl m represents the isolation degree of the target pixel point under the mth scale; gl j represents the isolation degree of the target pixel point under the jth scale; M represents the number of all scales, and M=10 in an embodiment of the present application.
[0092] In the process of obtaining the real saliency value of the target pixel point, the real saliency value S' is used to reflect the degree of crack feature exhibited by the target pixel point at each scale, and the greater the real saliency value, the more the target pixel point conforms to the crack feature, that is, the target pixel point is more likely to belong to the crack region, wherein the adjustment weight is used to weight and adjust the initial saliency value S m at each scale, wherein is used to normalize gl m , and the greater the adjustment weight of the target pixel point at each scale, the more reference should be given to the initial saliency value at this scale, so that the initial saliency values of the target pixel point at different scales can be weighted and summed by using the adjustment weight, the initial saliency values at different scales are optimized and adjusted, and thus a more accurate real saliency value of the target pixel point is obtained.
[0093] After obtaining the real saliency value of the target pixel point, the real saliency values of other pixel points in the RGB image can be obtained by the same method as above, and the quality detection of the plastic material surface can be realized based on the real saliency value in the subsequent process.
[0094] Step S4: Perform saliency detection on the computer digital image of the plastic material based on the real saliency value of each pixel point.
[0095] The real saliency value of each pixel point in the computer digital image under the RGB channel can be obtained by the above steps, and the greater the real saliency value of the pixel point, the closer the feature exhibited by the pixel point at multiple scales to the crack feature, so that the quality of the plastic material can be detected based on the real saliency value of each pixel point in the RGB image.
[0096] Preferably, the method for detecting the quality of the plastic material in one embodiment of the present application specifically comprises:
[0097] In the RGB image, the region composed of the pixel points with a real saliency value greater than a preset saliency threshold is regarded as a crack region, and if the crack region exists, the quality of the plastic material is unqualified, and the unqualified plastic material can be destroyed in the subsequent process to ensure the quality of the plastic material, wherein 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 scene, which is not limited herein.
[0098] To sum up, the embodiment of the application first acquires a computer digital image under an RGB channel, and performs color space conversion on the RGB image to obtain a luminance value of each pixel point; takes any one pixel point as a target pixel point, and constructs a plurality of scales of the target pixel point; according to the channel value and the luminance value of the pixel point in each scale of the target pixel point, obtains a color feature coefficient of the target pixel point under each scale; according to the color feature coefficient of the target pixel point under each scale, and the difference in luminance value between other pixel points except the target pixel point and the target pixel point in each scale, obtains a texture feature coefficient of the target pixel point under each scale; according to the difference in color feature coefficient and the difference in texture feature coefficient between the target pixel point and other pixel points except the target pixel point in the RGB image under the same scale, obtains an isolated degree of the target pixel point under each scale; performs saliency detection on the RGB image to obtain an initial saliency value of the target pixel point under each scale; combines the initial saliency value and the isolated degree of the target pixel point under all scales to obtain a real saliency value of the target pixel point, and then performs saliency identification detection on an abnormal area of the plastic material based on the real saliency value of each pixel point.
[0099] It should be noted that the above-mentioned sequence of the embodiments of the application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0100] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments.
Claims
1. A method of saliency detection of a computer digital image, characterized in that, The method comprises: acquiring a computer RGB image; performing color space conversion on the RGB image to obtain a luminance value of each pixel point; taking any one pixel point in the RGB image as a target pixel point, and constructing different scales of the target pixel point with the target pixel point as a starting point, wherein different scales include different numbers of pixel points in a preset direction; obtaining a color feature coefficient of the target pixel point in each scale according to channel values of the pixel points in each scale of the target pixel point and the luminance value; and obtaining a texture feature coefficient of the target pixel point in each scale according to the color feature coefficient of the target pixel point in each scale and a difference in luminance value between the target pixel point and other pixel points except the target pixel point in each scale; obtaining an isolation degree of the target pixel point in each scale according to a difference in the color feature coefficient and a difference in the texture feature coefficient between the target pixel point and other pixel points except the target pixel point in the RGB image in the same scale; performing saliency detection on the RGB image to obtain an initial saliency value of the target pixel point in each scale; and combining the initial saliency value and the isolation degree of the target pixel point in all scales to obtain a real saliency value of the target pixel point; detecting the quality of the plastic material based on the real saliency value of each pixel point.
2. The saliency detection method of computer digital images according to claim 1, characterized in that, The color feature coefficient of the target pixel point in each scale is obtained according to the channel values of the pixel points in each scale of the target pixel point and the luminance value, and comprises: taking a sum value of an R channel value, a G channel value, a B channel value and the luminance value of each pixel point in each scale of the target pixel point as a color parameter of each pixel point in each scale; taking an accumulated value of the color parameters of all pixel points in each scale of the target pixel point as a first feature parameter of the target pixel point in each scale; taking a combination of any two channels of the R channel, the G channel and the B channel as a channel group, and taking an absolute value of a difference value of the two channel values in each channel group as an initial channel value difference of each channel group; taking an accumulated value of the initial channel value differences of all channel groups of each pixel point in each scale of the target pixel point as an overall channel value difference of each pixel point in each scale; taking an accumulated value of the overall channel value differences of all pixel points in each scale of the target pixel point as a second feature parameter of the target pixel point in each scale; the color feature coefficient of the target pixel point in each scale is obtained according to the first feature parameter and the second feature parameter.
3. The saliency detection method of computer digital images according to claim 2, characterized in that, The color feature coefficient of the target pixel point in each scale is obtained according to the first feature parameter and the second feature parameter, and comprises: performing negative correlation normalization on a product value of the first feature parameter and the second feature parameter to obtain the color feature coefficient of the target pixel point in each scale.
4. The saliency detection method of computer digital images according to claim 1, characterized in that, The texture feature coefficient of the target pixel point in each scale is obtained according to the color feature coefficient of the target pixel point in each scale and a difference in luminance value between the target pixel point and other pixel points except the target pixel point in each scale, and comprises: In each scale of the target pixel point, an absolute value of a difference between each other pixel point except the target pixel point and the target pixel point is taken as an initial luminance value difference of each other pixel point in each scale; An accumulated value of the initial luminance value difference of all other pixel points in each scale of the target pixel point is taken as an overall luminance value difference of the target pixel point in each scale; A product value of the overall luminance value difference of the target pixel point in each scale and the color feature coefficient is taken as a texture feature coefficient of the target pixel point in each scale.
5. The saliency detection method of computer digital images according to claim 1, characterized in that, The obtaining of the isolation degree of the target pixel point in each scale according to the difference of the color feature coefficient and the difference of the texture feature coefficient between the target pixel point and other pixel points except the target pixel point in the RGB image in the same scale comprises: An arbitrary scale is selected as a target scale; An absolute value of a difference between each other pixel point except the target pixel point and the target pixel point in the target scale is taken as a color feature difference of each other pixel point in the target scale in the RGB image; An accumulated value of the color feature difference of all other pixel points in the target scale is normalized to obtain a color difference index of the target pixel point in the target scale; An absolute value of a difference between each other pixel point except the target pixel point and the target pixel point in the target scale is taken as a texture feature difference of each other pixel point in the target scale in the RGB image; An accumulated value of the texture feature difference of all other pixel points in the target scale is normalized to obtain a texture difference index of the target pixel point in the target scale; A product value of the color difference index and the texture difference index is taken as the isolation degree of the target pixel point in the target scale.
6. The saliency detection method of computer digital images according to claim 1, characterized in that, The obtaining of the initial saliency value of the target pixel point in each scale by performing saliency detection on the RGB image comprises: The initial saliency value of the target pixel point in each scale is obtained by performing saliency detection on the RGB image based on a saliency detection CA algorithm.
7. The saliency detection method of computer digital images according to claim 1, characterized in that, The obtaining of the real saliency value of the target pixel point by combining the initial saliency value and the isolation degree of the target pixel point in all scales comprises: The isolation degree of the target pixel point in each scale is normalized to obtain an adjustment weight of the target pixel point in each scale; The adjustment weight is taken as a weight of the initial saliency value of the target pixel point in the corresponding scale, and the initial saliency values of the target pixel point in all scales are weighted and summed to obtain the real saliency value of the target pixel point.
8. The saliency detection method of computer digital images according to claim 1, characterized in that, The detection of the quality of the plastic material based on the real saliency value of each pixel point comprises: In the RGB image, a region composed of pixel points with a real saliency value greater than a preset saliency threshold is taken as a crack region; If the crack region exists, the quality of the plastic material is unqualified.
9. The saliency detection method of computer digital images according to claim 1, characterized in that, The construction of different scales of the target pixel point with the target pixel point as a starting point comprises: The target pixel point is taken as a pixel point included in a first scale of the target pixel point. Taking the target pixel point as a starting point, m-1 pixel points closest to the target pixel point and the target pixel point are taken as pixel points contained by the mth scale of the target pixel point along the preset direction, m is 2, 3, 4…M, wherein M is a preset scale threshold, and the preset direction is a long edge direction of the plastic material in the RGB image.
10. The saliency detection method of computer digital images according to claim 1, characterized in that, The color space conversion of the RGB image to obtain the luminance value of each pixel point comprises: Converting the RGB image into a Lab color space to obtain a Lab image; Taking the L component value of each pixel point in the Lab image as the luminance value of the pixel point at the same position in the RGB image.
Citation Information
Patent Citations
Machine part fatigue crack identification method based on saliency characteristics
CN115082479A
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
Photovoltaic cell crack detection method and system based on image processing
CN119338808A
Indoor image enhancement method and system
CN119722499A