Tire blackness detection method and device
Patent Information
- Application Number
- CN202510856210.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-06-24
AI Technical Summary
[0005]本申请实施例提供了一种轮胎黑度检测方法及装置,以至少解决传统的轮胎色彩评价方案效率低、准确性差,难以获取低偏色黑度轮胎的技术问题
[0036]在本申请实施例中,通过色彩校准步骤确保了目标轮胎图像与标准黑色轮胎样本图像的色彩一致性,消除了因光源差异导致的检测误差。通过双线性插值算法缩放图像,不仅提高了图像处理速度,还优化了图像质量,使后续的HSV转换更加精准。将图像从RGB模式转化至HSV模式,通过在HSV模式下对图像的色相和亮度的分析,使得轮胎的黑色深度和色调得以精确量化,这是RGB色彩空间难以实现的。进而解决了传统的轮胎色彩评价方案效率低、准确性差,难以获取低偏色黑度轮胎的技术问题。
Smart Images

Figure CN121330076B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tire testing technology, and more specifically, to a method and apparatus for detecting tire blackness. Background Technology
[0002] In the tire manufacturing industry, especially for high-performance tires targeting the high-end market, the visual appeal of the tire's appearance has become one of the important factors for consumers. The black appearance of tires is not only favored for their wear resistance and anti-aging properties, but also serves as a high-end and stable visual symbol, enhancing the overall aesthetics of the tire and the brand image.
[0003] However, achieving a consistent and appropriately deep black on the tire surface is no easy task, and the industry faces particularly significant challenges, including the following: Limitations of the Lab color model: Traditional tire color evaluation is mostly based on the Lab color model, which, while providing information on color brightness (L... ), red-green axis (a ) and yellow-blue axis (b While the information provided is valuable, it lacks a clear description of the warm or cool undertones of tire black, and it's difficult to integrate this description with the effects of tire surface texture and changes in lighting conditions. This leads to discrepancies between the evaluation results and human visual perception. Furthermore, the testing process is costly and complex: the industry primarily relies on precision instruments such as spectrophotometers to test tire surface color quality under strict standard lighting conditions. This process is not only time-consuming and costly, but also often requires destructive sampling of the tires, severely impacting the rapid and non-destructive quality inspection on large-scale production lines. Finally, the results are often detached from real-world usage environments: laboratory test results often fail to adequately consider the various lighting conditions encountered by tires during actual road driving, such as direct sunlight, rainy weather, or nighttime lighting, and the true visual appearance of the tire surface.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a tire blackness detection method and apparatus to at least solve the technical problems of low efficiency, poor accuracy, and difficulty in obtaining low-color-biased blackness tires in traditional tire color evaluation schemes.
[0006] According to one aspect of the embodiments of this application, a tire blackness detection method is provided, comprising: acquiring a first RGB image of a target tire and a second RGB image of a standard black tire sample collected under the same lighting conditions; performing color calibration on the first RGB image based on the RGB values of the second RGB image and the corresponding RGB values of the standard black tire sample to obtain a third RGB image; scaling the third RGB image to a fourth RGB image of a preset pixel size based on a bilinear interpolation algorithm, and converting the fourth RGB image into a target HSV image; determining the average hue and average brightness of multiple pixels in the target HSV image respectively, and determining the comprehensive blackness value of the target tire based on the average hue and average brightness; and determining that the target tire is color qualified if the comprehensive blackness value is greater than a preset blackness threshold.
[0007] Optionally, acquiring a first RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions includes: acquiring a first RGB image of the surface texture area of the target tire and a second RGB image of the standard black tire sample, acquired by an image acquisition device under preset lighting conditions, wherein the preset lighting conditions include one of the following: natural light and simulated ambient light of the application scenario.
[0008] Optionally, color calibration of the first RGB image is performed based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample, including: determining the first RGB value corresponding to each pixel in the first RGB image and the second RGB value corresponding to each pixel in the second RGB image; obtaining the preset standard RGB value of the standard black tire sample; determining the average value of multiple second RGB values, and using the ratio of the standard RGB value to the average value as a color adjustment coefficient; and adjusting the first RGB value corresponding to each pixel in the first RGB image based on the color adjustment coefficient.
[0009] Optionally, scaling the third RGB image to a fourth RGB image of a preset pixel size based on a bilinear interpolation algorithm includes: dividing the third RGB image into multiple sub-regions on an even basis; for each sub-region, determining the center point of the sub-region, and determining the four pixels in the third RGB image that are closest to the center point, interpolating the third RGB values of the four pixels using a bilinear interpolation algorithm, and using the interpolation result as the comprehensive RGB value corresponding to the sub-region; using each sub-region in the third RGB image as a pixel in the fourth RGB image, and using the comprehensive RGB value corresponding to each sub-region in the third RGB image as the fourth RGB value of the corresponding pixel in the fourth RGB image.
[0010] Optionally, the third RGB values of the four pixels are interpolated using a bilinear interpolation algorithm, and the interpolation result is used as the comprehensive RGB value corresponding to the sub-region. This includes calculating the RGB value corresponding to the sub-region according to the following formula:
[0011]
[0012] In the formula, P is the center point of the sub-region. This represents the combined RGB value corresponding to the sub-region. , , , These are the four pixels in the third RGB image that are closest to the center point and are located to the upper left, upper right, lower left, and lower right of the center point P, respectively. , , , They represent , , , The corresponding third RGB value, , These represent the pixel coordinates of the center point P mapped to in the third RGB image, respectively. The pixel coordinates are the difference between the row and column directions, and the pixel coordinates mapped to the center point P are floating-point coordinates. , , , All pixel coordinates are integer coordinates.
[0013] Optionally, converting the fourth RGB image into the target HSV image includes: for each pixel in the fourth RGB image, determining the HSV value corresponding to the pixel according to the following formula, so as to convert the fourth RGB image into the target HSV image:
[0014]
[0015]
[0016]
[0017]
[0018]
[0019] exist In the case of taking ;
[0020] In the formula, R, G, and B are the normalized red, green, and blue component values of the pixels in the fourth RGB image, respectively; H, S, and V are the hue, saturation, and brightness of the corresponding pixels in the target HSV image, respectively; M represents the maximum value among R, G, and B values; m represents the minimum value among R, G, and B values; and C represents chromaticity.
[0021] Optionally, the above method further includes: for each pixel in the target HSV image, if the hue of the pixel is less than a preset hue threshold, correcting the hue of the pixel according to the following formula:
[0022]
[0023] In the formula, The original hue of the pixel. The hue after pixel correction. The preset standard hue value, This is the preset correction factor.
[0024] Optionally, the average hue and average brightness of multiple pixels in the target HSV image are determined separately, including:
[0025] For each pixel in the target HSV image, the hue of the pixel is converted from angular representation to polar coordinate representation according to the following formula:
[0026]
[0027] In the formula, H represents the hue of a pixel from an angle, and x and y are the abscissa and ordinate of the polar coordinate representation of the pixel's hue, respectively. The average hue of multiple pixels in the target HSV image is calculated using the following formula:
[0028]
[0029] In the formula, For average hue, , The average value is calculated as the average brightness of the x and y coordinates of the polar coordinates of the hue of multiple pixels in the target HSV image.
[0030] Optionally, the overall blackness value of the target tire is determined based on the average hue and average brightness, including: determining the standard deviation and maximum brightness of the brightness of multiple pixels in the target HSV image, and determining the ratio of the standard deviation to the maximum brightness as the impurity coefficient; using the difference between 1 and the average brightness as the average blackness of the target HSV image; and calculating the overall blackness value of the target tire according to the following formula:
[0031]
[0032] In the formula, BI is the overall blackness value of the target tire. , , These are the preset weighting coefficients. B represents the average blackness of the target HSV image. The standard hue is preset for the standard black tire sample, and k is the impurity coefficient.
[0033] According to another aspect of the embodiments of this application, a tire blackness detection device is also provided, comprising: an acquisition module, configured to acquire a first RGB image of a target tire and a second RGB image of a standard black tire sample collected under the same lighting conditions; a color calibration module, configured to perform color calibration on the first RGB image based on the RGB values of the second RGB image and the corresponding RGB values of the standard black tire sample to obtain a third RGB image; a conversion module, configured to scale the third RGB image to a fourth RGB image of a preset pixel size based on a bilinear interpolation algorithm, and convert the fourth RGB image into a target HSV image; a blackness determination module, configured to determine the average hue and average brightness of multiple pixels in the target HSV image respectively, and determine the comprehensive blackness value of the target tire based on the average hue and average brightness; and a verification module, configured to determine that the color of the target tire is qualified if the comprehensive blackness value is greater than a preset blackness threshold.
[0034] According to another aspect of the embodiments of this application, a computer program product is also provided, the computer program product comprising: a computer program, wherein the computer program, when executed by a processor, implements the above-described tire blackness detection method.
[0035] According to another aspect of the embodiments of this application, an electronic device is also provided, the electronic device including: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described tire blackness detection method through the computer program.
[0036] In this embodiment, a color calibration step ensures color consistency between the target tire image and the standard black tire sample image, eliminating detection errors caused by differences in light sources. Image scaling using bilinear interpolation not only improves image processing speed but also optimizes image quality, making subsequent HSV conversion more accurate. Converting the image from RGB to HSV mode, and analyzing the hue and brightness in HSV mode, allows for precise quantification of the tire's black depth and hue, which is difficult to achieve in the RGB color space. This solves the technical problems of traditional tire color evaluation schemes being inefficient, inaccurate, and unable to obtain tires with low-color-shifting blackness. Attached Figure Description
[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0038] Figure 1 This is a schematic flowchart of an optional tire blackness detection method according to an embodiment of this application;
[0039] Figure 2 This is a schematic diagram of an optional image segmentation and scaling according to an embodiment of this application;
[0040] Figure 3 This is a schematic diagram of an optional tire blackness detection device according to an embodiment of this application;
[0041] Figure 4 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0042] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0043] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0044] To better understand the embodiments of this application, the following is a translation and explanation of some nouns or terms that appear in the description of the embodiments of this application:
[0045] HSV (Hue-Saturation-Value) color model: This is a model used to describe color, similar to how people perceive color in everyday life. Hue (H) describes the type of color, saturation (S) represents the purity of the color, and value (V) represents the lightness or darkness of the color. In this invention, the HSV color model is used to more intuitively analyze the visual characteristics of the black color on a tire surface.
[0046] RGB (Red-Green-Blue) mode is a color representation method widely used in electronic devices and optical systems. This model is based on the human visual perception of the three primary colors—red, green, and blue—and mixes these three colors in different proportions to produce a wide range of colors. RGB mode is the most common color space in digital images and screen displays. In RGB mode, each primary color (red, green, and blue) has an intensity value from 0 to 255, forming the three dimensions of a color space. When the intensity of each color is set to 0, the lack of light results in black. Conversely, when the intensity of all colors is set to the maximum value (255), the superposition of light produces white. Intermediate combinations of values, through mixing the three primary colors in different proportions, can create almost all colors, from dark to light, from single colors to composite colors.
[0047] Bilinear interpolation scaling algorithm: Bilinear interpolation is an image scaling technique that calculates the value of a new pixel by analyzing the values of the surrounding four pixels. This algorithm can smoothly resize an image while maintaining image sharpness and color accuracy, making it suitable for texture feature extraction in the image preprocessing stage of this invention.
[0048] Impurity coefficient: In this application, this is an index used to quantify the unevenness of tire surface brightness and the distribution of impurities. It reflects whether there are localized brightness variations on the tire surface, such as dust, stains, or unevenness of the material itself, which affect the purity and consistency of the black color on the tire surface.
[0049] Example 1
[0050] According to an embodiment of this application, a tire blackness detection method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0051] Figure 1 This is a schematic flowchart of a tire blackness detection method according to an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0052] Step S102: Acquire the first RGB image of the target tire and the second RGB image of the standard black tire sample under the same lighting conditions;
[0053] Step S104: Based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample, perform color calibration on the first RGB image to obtain the third RGB image;
[0054] Step S106: Scale the third RGB image to a fourth RGB image of a preset pixel size based on the bilinear interpolation algorithm, and convert the fourth RGB image into the target HSV image;
[0055] Step S108: Determine the average hue and average brightness of multiple pixels in the target HSV image, and determine the comprehensive blackness value of the target tire based on the average hue and average brightness.
[0056] Step S110: If the overall blackness value is greater than the preset blackness threshold, the color of the target tire is determined to be qualified.
[0057] The following describes each step of the tire blackness detection method in conjunction with the specific implementation process.
[0058] As an optional implementation, acquiring a first RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions can be achieved by: acquiring a first RGB image of the surface texture area of the target tire and a second RGB image of the standard black tire sample, acquired by an image acquisition device under preset lighting conditions, wherein the preset lighting conditions include one of the following: natural light and simulated ambient light of the application scenario.
[0059] Specifically, when acquiring images, digital cameras or specialized industrial cameras with automatic exposure, autofocus, and white balance functions can be selected. These functions help capture high-quality images under different lighting conditions and reduce the interference of ambient light on color. The preset lighting conditions should simulate the target tire's main usage scenarios. For example, if the tire is mainly used for daily road driving, natural light can be the preferred acquisition condition; while for special occasions such as underground parking lots, tunnels, or night driving, light sources simulating the corresponding environment should be used for illumination to ensure the representativeness of the test results.
[0060] To ensure comprehensive image coverage and clarity, images should be captured at a fixed angle and distance, with the optimal angle and distance depending on the tire's size and texture. Generally, ensuring the entire tire surface texture area is captured while avoiding shadows and direct sunlight improves image quality. A standard black tire sample should be attached near the target tire and photographed under the same lighting conditions. A standard color chart can be established using the standard black tire sample, providing an absolute color reference that matches the optical properties of the ideal tire's outer rubber surface. During shooting, the standard color chart should be kept in a fixed and clearly visible position to facilitate accurate identification and color correction in subsequent image processing stages. The first and second RGB images should be saved in uncompressed raw file format to retain color information to the maximum extent.
[0061] Considering that changes in ambient light can cause deviations in tire surface color during image acquisition, a correction model for the influence of ambient light on color can be established by simultaneously capturing images of a standard black tire sample. Specifically, the color shift of the standard color chart under different lighting conditions can be analyzed and then applied to the color correction of the target tire image to eliminate the interference of ambient light changes on the detection results.
[0062] Different image acquisition devices may have different color response characteristics, resulting in inconsistent color representation in images of the same scene. To correct for device color cast, the theoretical RGB values of a standard color chart can be compared with the actual RGB values captured in the image during the image processing stage. Through linear transformation or other calibration algorithms, the image color benchmark can be unified to ensure color consistency in images acquired by different devices.
[0063] As an optional implementation, color calibration of the first RGB image based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample can be achieved in the following way: determine the first RGB value corresponding to each pixel in the first RGB image and the second RGB value corresponding to each pixel in the second RGB image respectively; obtain the preset standard RGB value of the standard black tire sample; determine the average value of multiple second RGB values, and use the ratio of the standard RGB value to the average value as the color adjustment coefficient; adjust the first RGB value corresponding to each pixel in the first RGB image based on the color adjustment coefficient.
[0064] To ensure that the accuracy of tire surface blackness evaluation is unaffected by equipment differences and changes in ambient lighting, this application proposes a refined calibration process to standardize image colors. The RGB color space is chosen for initial calibration because RGB is the raw data foundation for image acquisition, directly reflecting the camera sensor's response to the red, green, and blue bands. It can more accurately reflect color deviations caused by equipment and the environment; therefore, linear calibration in the RGB space should be prioritized during the color compensation stage.
[0065] Determine the RGB values of each pixel in the first RGB image and the second RGB image respectively. Assume that the preset standard RGB values of the standard black tire sample are as follows: , as well as The average value calculated for the second RGB image is obtained. , , Based on the standard RGB values and average RGB values of the second RGB channel, the color adjustment factor for each color channel can be obtained using the following formula:
[0066]
[0067]
[0068]
[0069] in, , and These represent the color adjustment coefficients for the corresponding R, G, and B color channels, respectively.
[0070] Assuming the RGB values of each pixel in the first RGB image are represented by R, G, and B respectively, then color compensation of the RGB values of each pixel in the first RGB image based on the color adjustment coefficient can be achieved using the following formula:
[0071]
[0072]
[0073]
[0074] in, , and These represent the RGB values of each pixel in the first RGB image after color compensation.
[0075] The above process not only considers pixel-level color differences but also effectively compensates for overall color shifts by calculating average values and adjustment coefficients, ensuring the accuracy and consistency of tire blackness detection under different lighting conditions. The introduction of the color calibration step solves the problem of fluctuations in detection results caused by changes in lighting in traditional detection methods, providing a solid foundation for standardized tire blackness detection.
[0076] As an optional implementation, scaling a third RGB image to a fourth RGB image of a preset pixel size based on bilinear interpolation can be achieved as follows: Divide the third RGB image into multiple sub-regions on an equal basis; for each sub-region, determine the center point of the sub-region and identify the four pixels in the third RGB image closest to the center point; use bilinear interpolation to interpolate the third RGB values of the four pixels, and use the interpolation result as the comprehensive RGB value corresponding to the sub-region; treat each sub-region in the third RGB image as a pixel in the fourth RGB image, and use the comprehensive RGB value corresponding to each sub-region in the third RGB image as the fourth RGB value of the corresponding pixel in the fourth RGB image.
[0077] Specifically, the corresponding positions of the pixels in the fourth RGB image within the third RGB image can be determined first. Assume the size of the third RGB image is W×D, and the size of the fourth RGB image is X×Y. In this application, it is assumed that the preset pixel size is 4×4, i.e., X=4, Y=4. Figure 2 A schematic diagram of an optional image segmentation scaling is shown, from Figure 2 As can be seen, the pixel unit of the original third RGB image is 8×10, and the pixel unit of the scaled fourth RGB image is 4×4. Therefore, the pixel value of any target pixel in the fourth RGB image can be determined by mapping to the pixel value of the center point of the corresponding sub-region of the third RGB image. Furthermore, the pixel value of the center point of each sub-region of the third RGB image can be determined by weighting the pixel values of the four pixels closest to the center point.
[0078] As an optional implementation, the third RGB values of the four pixels are interpolated using a bilinear interpolation algorithm, and the interpolation result is used as the comprehensive RGB value corresponding to the sub-region. This can be achieved by calculating the RGB value corresponding to the sub-region according to the following formula:
[0079]
[0080] In the formula, P is the center point of the sub-region. This represents the combined RGB value corresponding to the sub-region. , , , These are the four pixels in the third RGB image that are closest to the center point and are located to the upper left, upper right, lower left, and lower right of the center point P, respectively. , , , They represent , , , The corresponding third RGB value, , These represent the pixel coordinates of the center point P mapped to in the third RGB image, respectively. The pixel coordinates are the difference between the row and column directions, and the pixel coordinates mapped to the center point P are floating-point coordinates. , , , All pixel coordinates are integer coordinates.
[0081] Combination Figure 2 The demonstration illustrates the first pixel in the fourth RGB image. The calculation process shows that the center point of the first sub-region in the third RGB image is In the third RGB image, the four pixels closest to the center point are respectively , , , The pixel coordinates of the four pixels are (1,1), (1,2), (2,1), and (2,2). Therefore, the pixel coordinates of the center point P in the third RGB image are (1.5, 1.75).
[0082] The first pixel in the fourth RGB image can be calculated using the following formula. Pixel values:
[0083]
[0084] Based on the coordinate numerical relationships above, The x-coordinate of the center point P in the third RGB image should be taken as the x-coordinate of the point. The difference in the x-coordinates of the pixels is 0.5. The pixel ordinate of the center point P in the third RGB image should be taken as the coordinate of the point. The difference in the pixel ordinates is 0.75. Combined with the pixel values of each pixel in the first sub-region of the third RGB image, the pixel value of the center point P can be determined using the weighted method described above. The pixel value of the center point P is then used as the first pixel in the fourth RGB image. The pixel value, the calculation process for the pixel values of other pixels in the fourth RGB image, is the same as that for the first pixel. The calculation process is the same and will not be repeated here. The above calculation process is repeated until the pixel matrix of the fourth RGB image with the preset pixel size is constructed.
[0085] Bilinear interpolation estimates the RGB value of the center point by calculating a weighted average of four neighboring pixels. This method is particularly suitable for tasks such as image scaling and color correction. (The formula contains...) and These values represent the positional relationship of the center point relative to its surrounding pixels, ranging from 0 to 1. They reflect the distance between the center point and its upper-left neighboring pixels in both the horizontal and vertical directions. In this way, the interpolation algorithm can finely adjust the color value of each pixel, thus maintaining the clarity of the tire surface texture and the realism of the colors while scaling the image.
[0086] As an optional implementation, the fourth RGB image can be converted into the target HSV image in the following way: For each pixel in the fourth RGB image, the HSV value corresponding to the pixel is determined according to the following formula, so as to convert the fourth RGB image into the target HSV image:
[0087]
[0088]
[0089]
[0090]
[0091]
[0092] exist In the case of taking ;
[0093] In the formula, R, G, and B are the normalized red, green, and blue component values of the pixels in the fourth RGB image, respectively; H, S, and V are the hue, saturation, and brightness of the corresponding pixels in the target HSV image, respectively; M represents the maximum value among R, G, and B values; m represents the minimum value among R, G, and B values; and C represents chromaticity.
[0094] Converting the fourth RGB image to the target HSV image typically involves the following steps:
[0095] Step S1: Normalization.
[0096] Typically, the color values of RGB images range from 0 to 255. Therefore, before performing HSV conversion, the RGB values in the fourth RGB image need to be normalized to the range [0,1]. The normalization formula is:
[0097]
[0098]
[0099]
[0100] in, R, G, and B represent the unnormalized red, green, and blue component values of the pixels in the fourth RGB image, respectively, while R, G, and B represent the normalized red, green, and blue component values of the pixels in the fourth RGB image, respectively.
[0101] Step S2: Determine the chromaticity C.
[0102] For each pixel, the maximum value M and minimum value m of its red, green and blue components are determined, thereby determining the chromaticity C (i.e. the purity of the color), where C is the difference between the maximum and minimum values.
[0103] Step S3: Calculate the brightness V.
[0104] The brightness V value of each pixel is directly determined by the maximum value M, which reflects the lightness or darkness of the color (V = M).
[0105] Step S4: Calculate the saturation S.
[0106] Saturation reflects the purity or intensity of a color. When V is 0 (i.e., the color is completely black), S is also defined as 0, indicating no color. When V is not 0, S is the ratio of chromaticity C to luminance V, representing the ratio of color to lightness.
[0107] Step S5: Calculate the hue H.
[0108] Hue (H) is used to describe the type of color. As can be seen from the formula for calculating hue above, when C is 0, that is, the color is gray or completely colorless, it is defined as... When C is not equal to 0, H is calculated using different formulas depending on whether the maximum value M is R, G, or B. This process involves converting color values into angles, thereby quantifying the position of the color on the color wheel.
[0109] If the calculated hue is less than 0, this may be because the result of the modulo operation is lower than 0. In this case, the value of H is corrected to The sum of H and H ensures that the hue value falls within the range of H. arrive Within the range, it conforms to the definition of the HSV color space.
[0110] HSV color space conversion is a crucial step in tire blackness detection. It converts the RGB color model into three dimensions—H (hue), S (saturation), and V (brightness)—that better align with human visual perception. The V (brightness) value, in particular, directly reflects the depth of black on the tire surface. The entire conversion process is accomplished through a series of mathematical operations, including solving for maximum and minimum values, chromaticity, and brightness, ultimately yielding the HSV value for each pixel. The advantage of the HSV color space lies in its ability to intuitively reflect the warm / cool undertones and depth of black on the tire surface, which is essential for assessing tire appearance quality and consistency.
[0111] Hue correction is crucial when processing tire surface features, taking into account hue loss caused by lighting conditions or camera characteristics. This process ensures that the hue H in the HSV color mode more accurately reflects the warm or cool undertones of the tire surface black, thus providing more consistent and reliable data for assessing blackness and overall visual quality.
[0112] As an optional implementation, the method further includes: for each pixel in the target HSV image, if the hue of the pixel is less than a preset hue threshold, correcting the hue of the pixel according to the following formula:
[0113]
[0114] In the formula, The original hue of the pixel. The hue after pixel correction. The preset standard hue value, This is the preset correction factor.
[0115] The hue correction process can be achieved through the following steps.
[0116] Step S1, Hue of the dark area color block extract.
[0117] From the target HSV image, first locate the dark areas of the tire surface, which are typically the closest to pure black and have the lowest luminance (V) value. For each pixel within this area, extract its original hue. The hue of the dark areas It reflects the basic color tendency of the tire under low light or shadow conditions and is the basis for correcting hue loss.
[0118] Step S2, highlight hue The determination.
[0119] Similarly, from the target HSV image, identify the bright areas on the tire surface, which are typically the parts with the strongest reflected light. Calculate the average hue of the bright areas. This serves as the preset standard hue value. Hue of the highlights. Understanding the range and trend of tire color changes under different lighting conditions is crucial and helps to correct color deviations caused by lighting.
[0120] Step S3: Determine the correction coefficient γ.
[0121] The correction factor γ should be determined based on experimental and practical application needs. It reflects the degree of adjustment between the hue difference in dark and light areas. The value of γ should be preset to balance the intensity of hue correction and avoid color distortion caused by over-correction.
[0122] Step S4: Apply the hue correction formula.
[0123] For each pixel in the target HSV image, if its hue H is less than a preset hue threshold (i.e., close to a hue deficiency), the pixel's hue is corrected according to the aforementioned hue correction formula. This formula adjusts the preset standard hue value... Gradually introduced into pixels lacking hue to enhance their color performance and visual consistency.
[0124] When implementing the correction, it is necessary to ensure that the corrected hue H' remains within the effective range of the HSV color space, that is... arrive If H' after the correction process is less than 0°, it should be processed according to the periodicity of the HSV color mode, using H'=H'+360°, to ensure the accuracy of the hue.
[0125] To calculate the overall blackness, we need to calculate the average brightness and average hue.
[0126] As an optional implementation, determining the average hue and average brightness of multiple pixels in the target HSV image can be achieved in the following way:
[0127] For each pixel in the target HSV image, the hue of the pixel is converted from angular representation to polar coordinate representation according to the following formula:
[0128]
[0129] In the formula, H represents the hue of a pixel from an angle, and x and y are the abscissa and ordinate of the polar coordinate representation of the pixel's hue, respectively. The average hue of multiple pixels in the target HSV image is calculated using the following formula:
[0130]
[0131] In the formula, For average hue, , The average value is calculated as the average brightness of the x and y coordinates of the polar coordinates of the hue of multiple pixels in the target HSV image.
[0132] In the above process, when calculating the average hue, it is especially necessary to consider the periodicity of the hue value to avoid unreasonable results caused by directly using the arithmetic mean.
[0133] For each pixel in the target HSV image, its hue H is an angular quantity, ranging from... arrive In order to calculate the average hue, these angle values first need to be converted into planar coordinates (x, y) in polar coordinates, where x and y represent the horizontal and vertical coordinates of the hue of each pixel in polar coordinates, respectively. Through the above conversion, the hue value of each pixel is mapped to a unit vector on a two-dimensional plane.
[0134] After converting the hue values of all pixels to polar coordinates, it is necessary to calculate the average of these coordinate values. )and( ), which is the arithmetic mean of all x and y values. The average coordinate value reflects the comprehensive direction of the hue features of all pixels.
[0135] in accordance with and The value is used to calculate the average hue using the inverse trigonometric function arctan2. The arctan2 function can be considered and By observing the sign of the hue, the polar angle of the average hue can be accurately calculated. This calculation method avoids misjudgments caused by the periodicity of hue values, ensuring the accuracy of the average hue.
[0136] Furthermore, if the calculated average hue is less than It should be added It is corrected to ensure that it is within the effective range, thereby correctly reflecting the average tendency of the tire surface color characteristics.
[0137] The average brightness V of multiple pixels in a target HSV image can be directly calculated as the arithmetic mean of all V values, and is taken as the average brightness. This calculation method is simple and direct, and applies to the brightness values of all pixels, regardless of their magnitude.
[0138] As an optional implementation, the overall blackness value of the target tire based on average hue and average brightness can be determined as follows: The standard deviation and maximum brightness of the brightness of multiple pixels in the target HSV image are determined; the ratio of the standard deviation to the maximum brightness is determined as the impurity coefficient; the difference between 1 and the average brightness is taken as the average blackness of the target HSV image; the overall blackness value of the target tire is calculated according to the following formula:
[0139]
[0140] In the formula, BI is the overall blackness value of the target tire. , , These are the preset weighting coefficients. B represents the average blackness of the target HSV image. The standard hue is preset for the standard black tire sample, and k is the impurity coefficient.
[0141] When determining the impurity coefficient, it is first necessary to calculate the standard deviation of the brightness values V of all pixels in the target HSV image. The standard deviation of brightness reflects the degree of fluctuation in brightness values in an image and is a quantitative indicator of brightness non-uniformity. Next, identify the maximum brightness value in the image. This is a reference point for evaluating the brightest part of the tire surface. The impurity coefficient can then be expressed by the following formula:
[0142]
[0143] The process of determining the impurity coefficient reflects the range of k values from 0 to 1, where 0 represents completely impurity-free (completely uniform brightness) and 1 represents a completely impurity-free state (the standard deviation of brightness is equal to the maximum brightness, indicating that the brightness is extremely non-uniform).
[0144] Since V is inversely proportional to emissivity, the complement of average luminance is its average emissivity. Average emissivity can be expressed as:
[0145]
[0146] in, This represents the average brightness. The closer the average blackness (B) value is to 1, the deeper the blackness of the tire surface, and the higher the blackness.
[0147] Next, calculate the hue deviation. The standard black tire sample has a preset standard hue. It serves as a reference point for assessing the accuracy of the tire's surface hue. Hue deviation. By calculating the average hue of all pixels and The absolute distance between them determines the color. The smaller the hue deviation ΔH, the closer the hue of the tire surface is to standard black, the smaller the hue deviation, and thus the stronger the perception of blackness and the more consistent the color.
[0148] Based on the values and blackness values obtained above The formula can be used to calculate the overall blackness value of the target tire corresponding to the target HSV image. Among them, , and These are preset weighting coefficients, and the sum of the three factors must equal 1 to ensure the integrity of the evaluation system. Weighting coefficients , and The choice of [specific material / material] should be based on specific application needs and scenarios. For example, if the target tires are mainly used in the high-end market and users have high requirements for blackness depth, then [specific material / material] can be added. The proportion of blackness is emphasized, highlighting its importance. Conversely, if hue consistency or surface cleanliness are the primary considerations, then the proportion should be increased accordingly. and The weight.
[0149] Through the above calculations, we obtained the Comprehensive Blackness Value (BI) of the target tire, a comprehensive evaluation index that integrates blackness, hue consistency, and brightness uniformity. This method fully considers the multi-dimensional needs of tire blackness detection, focusing not only on the depth of the tire surface but also on color consistency and surface purity, thus enabling a more accurate assessment of the tire's appearance quality. Based on the BI value, we can accurately determine the quality of the black appearance of the tire surface, guiding color control and optimization during the production process.
[0150] Through the above steps, the color calibration process ensures color consistency between the target tire image and the standard black tire sample image, eliminating detection errors caused by differences in light sources. Scaling the image using bilinear interpolation not only improves image processing speed but also optimizes image quality, making subsequent HSV conversion more accurate. Converting the image from RGB to HSV mode, and analyzing the hue and brightness in HSV mode, allows for precise quantification of the tire's black depth and hue—something difficult to achieve in the RGB color space. This solves the technical problems of traditional tire color evaluation schemes being inefficient, inaccurate, and unable to obtain tires with low-color-biased blackness.
[0151] Example 2
[0152] According to an embodiment of this application, a tire blackness detection device for implementing the tire blackness detection method in Embodiment 1 is also provided, such as... Figure 3As shown, the tire blackness detection device includes at least: an acquisition module 31, a color calibration module 32, a conversion module 33, a blackness determination module 34, and a verification module 35, wherein:
[0153] The acquisition module 31 can acquire a first RGB image of the target tire and a second RGB image of a standard black tire sample collected under the same lighting conditions;
[0154] The color calibration module 32 can perform color calibration on the first RGB image based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample to obtain the third RGB image;
[0155] The conversion module 33 can scale the third RGB image to a fourth RGB image of a preset pixel size based on the bilinear interpolation algorithm, and convert the fourth RGB image into an HSV image;
[0156] The blackness determination module 34 can determine the average hue and average brightness of multiple pixels in the target HSV image, and determine the comprehensive blackness value of the target tire based on the average hue and average brightness.
[0157] The verification module 35 can determine that the color of the target tire is qualified if the overall blackness value is greater than the preset blackness threshold.
[0158] The following section explains the functions of each module of the tire blackness detection device in conjunction with the specific implementation process.
[0159] As an optional implementation, the acquisition module can acquire the first RGB image of the target tire and the second RGB image of the standard black tire sample under the same lighting conditions in the following way: acquire the first RGB image of the surface texture area of the target tire and the second RGB image of the standard black tire sample acquired by the image acquisition device under preset lighting conditions, wherein the preset lighting conditions include one of the following: natural light and simulated ambient light of the application scenario.
[0160] As an optional implementation, the color calibration module can perform color calibration on the first RGB image based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample in the following way: determine the first RGB value corresponding to each pixel in the first RGB image and the second RGB value corresponding to each pixel in the second RGB image respectively; obtain the preset standard RGB value of the standard black tire sample; determine the average value of multiple second RGB values, and use the ratio of the standard RGB value to the average value as the color adjustment coefficient; adjust the first RGB value corresponding to each pixel in the first RGB image based on the color adjustment coefficient.
[0161] As an optional implementation, the conversion module can scale the third RGB image to a fourth RGB image of a preset pixel size based on the bilinear interpolation algorithm in the following way: Divide the third RGB image into multiple sub-regions on an equal basis; for each sub-region, determine the center point of the sub-region and determine the four pixels in the third RGB image that are closest to the center point; use the bilinear interpolation algorithm to interpolate the third RGB values of the four pixels, and use the interpolation result as the comprehensive RGB value corresponding to the sub-region; treat each sub-region in the third RGB image as a pixel in the fourth RGB image, and use the comprehensive RGB value corresponding to each sub-region in the third RGB image as the fourth RGB value of the corresponding pixel in the fourth RGB image.
[0162] As an optional implementation, the conversion module uses bilinear interpolation to interpolate the third RGB values of the four pixels, and the interpolation result is used as the comprehensive RGB value corresponding to the sub-region. This can be achieved by calculating the RGB value corresponding to the sub-region according to the following formula:
[0163]
[0164] In the formula, P is the center point of the sub-region. This represents the combined RGB value corresponding to the sub-region. , , , These are the four pixels in the third RGB image that are closest to the center point and are located to the upper left, upper right, lower left, and lower right of the center point P, respectively. , , , They represent , , , The corresponding third RGB value, , These represent the pixel coordinates of the center point P mapped to in the third RGB image, respectively. The pixel coordinates are the difference between the row and column directions, and the pixel coordinates mapped to the center point P are floating-point coordinates. , , , All pixel coordinates are integer coordinates.
[0165] As an optional implementation, the conversion module can convert the fourth RGB image into the target HSV image in the following way: For each pixel in the fourth RGB image, the HSV value corresponding to the pixel is determined according to the following formula, so as to convert the fourth RGB image into the target HSV image:
[0166]
[0167]
[0168]
[0169]
[0170]
[0171] exist In the case of taking ;
[0172] In the formula, R, G, and B are the normalized red, green, and blue component values of the pixels in the fourth RGB image, respectively; H, S, and V are the hue, saturation, and brightness of the corresponding pixels in the target HSV image, respectively; M represents the maximum value among R, G, and B values; m represents the minimum value among R, G, and B values; and C represents chromaticity.
[0173] As an optional implementation, for each pixel in the target HSV image, the conversion module can also correct the hue of the pixel according to the following formula if the hue of the pixel is less than a preset hue threshold:
[0174]
[0175] In the formula, The original hue of the pixel. The hue after pixel correction. The preset standard hue value, This is the preset correction factor.
[0176] As an optional implementation, the blackness determination module can determine the average hue and average brightness of multiple pixels in the target HSV image in the following way: For each pixel in the target HSV image, the hue of the pixel is converted from angular representation to polar coordinate representation according to the following formula:
[0177]
[0178] In the formula, H represents the angle of the pixel's hue. , Let x and y be the polar coordinates of the pixel's hue, respectively; calculate the average hue of multiple pixels in the target HSV image using the following formula:
[0179]
[0180] In the formula, For average hue, , The average value is calculated as the average brightness of the x and y coordinates of the polar coordinates of the hue of multiple pixels in the target HSV image.
[0181] As an optional implementation, the blackness determination module can determine the overall blackness value of the target tire based on average hue and average brightness in the following way: determine the standard deviation and maximum brightness of the brightness of multiple pixels in the target HSV image, and determine the ratio coefficient between the standard deviation and the maximum brightness; use the difference between 1 and the average brightness as the average blackness of the target HSV image; calculate the overall blackness value of the target tire according to the following formula:
[0182]
[0183] In the formula, BI is the overall blackness value of the target tire. , , These are the preset weighting coefficients. B represents the average blackness of the target HSV image. The standard hue is preset for the standard black tire sample, and k is the impurity coefficient.
[0184] It should be noted that each module in the tire blackness detection device in this embodiment corresponds one-to-one with each implementation step of the tire blackness detection method in Embodiment 1. Since Embodiment 1 has been described in detail, some details not shown in this embodiment can be referred to Embodiment 1, and will not be elaborated further here.
[0185] Example 3
[0186] According to an embodiment of this application, a computer program product is also provided, which includes a computer program, wherein when the computer program is executed by a processor, it implements the tire blackness detection method in Embodiment 1.
[0187] According to an embodiment of this application, a non-volatile storage medium is also provided, which includes a stored computer program, wherein the device containing the non-volatile storage medium executes the tire blackness detection method in Embodiment 1 by running the computer program.
[0188] According to an embodiment of this application, a processor is also provided for running a computer program, wherein the computer program executes the tire blackness detection method in Embodiment 1 when it runs.
[0189] According to an embodiment of this application, an electronic device is also provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the tire blackness detection method of Embodiment 1 through the computer program.
[0190] Specifically, the computer program executes the following steps during runtime: acquiring a first RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions; step S104, color calibrating the first RGB image based on the RGB values of the second RGB image and the corresponding RGB values of the standard black tire sample to obtain a third RGB image; step S106, scaling the third RGB image to a fourth RGB image of a preset pixel size based on a bilinear interpolation algorithm, and converting the fourth RGB image into a target HSV image; step S108, determining the average hue and average brightness of multiple pixels in the target HSV image, and determining the comprehensive blackness value of the target tire based on the average hue and average brightness; step S110, determining that the color of the target tire is qualified if the comprehensive blackness value is greater than a preset blackness threshold.
[0191] As an alternative implementation, the above-mentioned electronic device may exist in the form of a mobile terminal, a computer terminal, or a similar computing device. Figure 4 A hardware block diagram of an electronic device for implementing a tire blackness detection method is shown. Figure 4 As shown, the electronic device 40 may include one or more (shown as 402a, 402b, ..., 402n) processors 402 (processors 402 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 404 for storing data, and a transmission device 406 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 4 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 40 may also include... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown.
[0192] It should be noted that the aforementioned one or more processors 402 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element of the electronic device 40. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0193] The memory 404 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the tire blackness detection method in this embodiment. The processor 402 executes various functional applications and data processing by running the software programs and modules stored in the memory 404, thereby implementing the aforementioned application vulnerability detection method. The memory 404 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 404 may further include memory remotely located relative to the processor 402, and these remote memories can be connected to the electronic device 40 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0194] The transmission device 406 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 40. In one example, the transmission device 406 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0195] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the electronic device 40.
[0196] The sequence numbers of the above embodiments are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0197] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0198] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0199] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0200] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0201] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0202] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for detecting tire blackness, characterized in that, include: Acquire a first red-green-blue RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions; The first RGB image is color-calibrated based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample to obtain the third RGB image; The third RGB image is scaled to a fourth RGB image of a preset pixel size based on the bilinear interpolation algorithm, and the fourth RGB image is converted into a target hue-saturation-luminance HSV image. The average hue and average brightness of multiple pixels in the target HSV image are determined respectively; Determining the overall blackness value of the target tire based on the average hue and the average brightness includes: determining the standard deviation and maximum brightness of the brightness of multiple pixels in the target HSV image; determining the ratio of the standard deviation to the maximum brightness as the impurity coefficient; using the difference between 1 and the average brightness as the average blackness of the target HSV image; and calculating the overall blackness value of the target tire according to the following formula: In the formula, BI is the overall blackness value of the target tire. , , These are the preset weighting coefficients. B represents the average blackness of the target HSV image. The average hue, The standard hue is preset for the standard black tire sample, and k is the impurity coefficient; If the overall blackness value is greater than a preset blackness threshold, the target tire is determined to be of acceptable color.
2. The method according to claim 1, characterized in that, Acquire a first RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions, including: The image acquisition device acquires a first RGB image corresponding to the surface texture area of the target tire under preset lighting conditions, and a second RGB image corresponding to a standard black tire sample. The preset lighting conditions include one of the following: natural light and simulated ambient light of the application scenario.
3. The method according to claim 1, characterized in that, Color calibration of the first RGB image is performed based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample, including: Determine the first RGB value corresponding to each pixel in the first RGB image and the second RGB value corresponding to each pixel in the second RGB image, respectively; Obtain the preset standard RGB values of the standard black tire sample; The average value of multiple second RGB values is determined, and the ratio of the standard RGB value to the average value is used as a color adjustment coefficient; The first RGB value corresponding to each pixel in the first RGB image is adjusted based on the color adjustment coefficient.
4. The method according to claim 1, characterized in that, Scaling the third RGB image to a fourth RGB image of a preset pixel size using a bilinear interpolation algorithm includes: The third RGB image is divided into multiple sub-regions on an average basis; For each sub-region, determine the center point of the sub-region, and determine the four pixels in the third RGB image that are closest to the center point. Use bilinear interpolation algorithm to interpolate the third RGB values of the four pixels, and use the interpolation result as the comprehensive RGB value corresponding to the sub-region. Each sub-region in the third RGB image is used as a pixel in the fourth RGB image, and the combined RGB value corresponding to each sub-region in the third RGB image is used as the fourth RGB value of the corresponding pixel in the fourth RGB image.
5. The method according to claim 4, characterized in that, The third RGB values of the four pixels are interpolated using a bilinear interpolation algorithm, and the interpolation result is used as the comprehensive RGB value corresponding to the sub-region, including: The RGB value corresponding to the sub-region is calculated according to the following formula: ; In the formula, P is the center point of the sub-region. This represents the combined RGB value corresponding to the sub-region. , , , These are the four pixels in the third RGB image that are closest to the center point and are respectively located above, below, to the left, and to the right of the center point P. , , , They represent , , , The corresponding third RGB value, , These respectively represent the pixel coordinates of the center point P mapped to in the third RGB image and... The pixel coordinates are the difference between the row and column directions, and the pixel coordinates mapped to the center point P are floating-point coordinates. , , , All pixel coordinates are integer coordinates.
6. The method according to claim 1, characterized in that, Converting the fourth RGB image into the target HSV image includes: For each pixel in the fourth RGB image, the HSV value corresponding to the pixel is determined according to the following formula, so as to convert the fourth RGB image into the target HSV image: ; ; ; ; ; exist In the case of taking ; In the formula, R, G, and B are the normalized red, green, and blue component values of the pixels in the fourth RGB image, respectively; H, S, and V are the hue, saturation, and brightness of the corresponding pixels in the target HSV image, respectively; M represents the maximum value among R, G, and B values; m represents the minimum value among R, G, and B values; and C represents chromaticity.
7. The method according to claim 6, characterized in that, The method further includes: For each pixel in the target HSV image, if the hue of the pixel is less than a preset hue threshold, the hue of the pixel is corrected according to the following formula: ; In the formula, The original hue of the pixel. The corrected hue of the pixel. The preset standard hue value, This is the preset correction factor.
8. The method according to claim 1, characterized in that, Determining the average hue and average brightness of multiple pixels in the target HSV image, including: For each pixel in the target HSV image, the hue of the pixel is converted from angular representation to polar coordinate representation according to the following formula: ; In the formula, H is the angular representation of the hue of the pixel, and x and y are the abscissa and ordinate of the polar coordinate representation of the hue of the pixel, respectively. The average hue of multiple pixels in the target HSV image is calculated using the following formula: ; In the formula, , These are the average values of the polar coordinates of the hue of multiple pixels in the target HSV image, representing the horizontal and vertical coordinates respectively. The average brightness is calculated by directly calculating the average brightness of multiple pixels in the target HSV image.
9. A tire blackness detection device, characterized in that, include: The acquisition module is used to acquire a first red-green-blue RGB image of the target tire and a second RGB image of a standard black tire sample under the same lighting conditions; A color calibration module is used to perform color calibration on the first RGB image based on the RGB values of the second RGB image and the RGB values corresponding to the standard black tire sample, so as to obtain a third RGB image; The conversion module is used to scale the third RGB image to a fourth RGB image of a preset pixel size based on a bilinear interpolation algorithm, and to convert the fourth RGB image into a target hue-saturation-brightness HSV image; The blackness determination module is used to determine the average hue and average brightness of multiple pixels in the target HSV image, respectively. It is also used to determine the overall blackness value of the target tire based on the average hue and the average brightness, including: determining the standard deviation and maximum brightness of the brightness of multiple pixels in the target HSV image, and determining the ratio of the standard deviation to the maximum brightness as the impurity coefficient; taking the difference between 1 and the average brightness as the average blackness of the target HSV image; and calculating the overall blackness value of the target tire according to the following formula: In the formula, BI is the overall blackness value of the target tire. , , These are the preset weighting coefficients. B represents the average blackness of the target HSV image. The average hue, The standard hue is preset for the standard black tire sample, and k is the impurity coefficient; The verification module is used to determine that the color of the target tire is qualified if the overall blackness value is greater than a preset blackness threshold.
10. A computer program product, characterized in that, include: A computer program, wherein when executed by a processor, the computer program implements the tire blackness detection method according to any one of claims 1 to 8.
11. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the tire blackness detection method according to any one of claims 1 to 8 through the computer program.
Citation Information
Patent Citations
Method and device for determining the color homogeneity of hair
CN109923385A
Colorimetric imaging system for measuring color and appearance
US5850472A