A visual inspection method and system for grade sorting of molybdenum oxide products.
By constructing a pure illumination map and a shadow compensation factor, combined with color difference calculation, the problem of shadows being misjudged as impurities in traditional visual inspection was solved, enabling accurate sorting of molybdenum oxide product grades and improving inspection accuracy and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional 2D machine vision inspection technology is prone to misjudging harmless shaded areas as impurities in the grade sorting of molybdenum oxide products, resulting in the wrong rejection of qualified products, causing material waste and reduced production efficiency.
By converting color images into luminance and chrominance channels, constructing a pure illumination map and a shadow compensation factor, dynamically adjusting the compensation intensity, and calculating the color difference using the CIE Delta E 2000 formula, accurate separation of shadows and real defects is achieved.
It improved the accuracy and automation of testing, reduced the false rejection rate of qualified products, and increased production efficiency and yield.
Smart Images

Figure CN121258987B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a visual inspection method and system for grade sorting of molybdenum oxide products. Background Technology
[0002] Molybdenum oxide (MoO3) is an important chemical raw material for preparing various high-value-added products such as metallic molybdenum, molybdenum alloys, and molybdenum compounds. Its grade directly affects the final performance and quality of downstream products. In industrial production and high-purity applications, the grade of molybdenum oxide is usually judged comprehensively based on its color (such as pure pale yellow, grayish yellow, or slightly green), impurity content (such as darker-colored low-valence molybdenum oxide MoO2 or incompletely reacted raw materials), and physical morphology (such as the uniformity of the powder and the presence of agglomeration).
[0003] Traditional 2D machine vision inspection technology has been applied in this field, but it has significant limitations. These methods are typically based on the RGB (red, green, blue) color space of material images, and distinguish between qualified and defective products by setting fixed color thresholds in the program.
[0004] However, the robustness and accuracy of the aforementioned traditional methods are severely challenged, especially when processing piled-up powders or irregular granular materials. When molybdenum oxide powder or materials are piled up, uneven lighting naturally creates shadows. These shadows often appear as dark red or dark gray areas in 2D images that are difficult to distinguish from impurities, and their color characteristics are highly similar to those of dark red impurities such as MoO2. Therefore, traditional visual methods are highly prone to misjudging these harmless shadow areas as impurities, leading to the incorrect rejection of a large number of qualified products. This not only causes significant material waste but also significantly reduces production efficiency and yield. Summary of the Invention
[0005] This invention provides a visual inspection method and system for grade sorting of molybdenum oxide products, aiming to solve the problem in related technologies that these harmless shaded areas are misjudged as impurities, resulting in the incorrect rejection of a large number of qualified products, which not only causes serious material waste, but also significantly reduces production efficiency and yield.
[0006] In a first aspect, the present invention provides a visual inspection method for grade sorting of molybdenum oxide products, comprising: acquiring a color image of a molybdenum oxide product and converting the color image into a color space including a luminance channel and at least one chrominance channel; in response to obtaining a reflectance residual by dividing the luminance value of each pixel by the corresponding initial illumination value, mapping the reflectance residual to a purity confidence score, wherein the initial illumination value is obtained by Gaussian smoothing the luminance channel; constructing a purity illumination map, comprising performing weighted Gaussian smoothing on the luminance channel, wherein the weighting coefficient is the purity confidence score, based on the chrominance of each pixel and... The method determines the dynamic compensation gain based on the similarity of the preset prior chromaticity. According to the pure illumination map and the dynamic compensation gain, a shadow compensation factor is constructed for each pixel. This shadow compensation factor is applied to the luminance channel to obtain a compensated pure luminance map. The compensated pure luminance map is then merged with at least one chromaticity channel to obtain a compensated color image. The median color difference of all pixels in the compensated color image is calculated as the dynamic reference color difference. A color difference score is obtained by calculating the color difference between each pixel and the dynamic reference color difference. If a color difference score exceeds a set threshold, the molybdenum oxide product is determined to have a defect and is graded. By constructing a purity confidence level to guide the accurate estimation of the illumination map and dynamically adjusting the compensation intensity based on the material's color characteristics, selective elimination of shadows is achieved. This method effectively separates the visual features of shadows and actual defects, greatly improving the accuracy and automation level of detection and reducing the false rejection rate of qualified products.
[0007] Furthermore, the method for calculating the purity confidence score includes: In the formula, It is a pixel. The confidence score represents the pixel. The probability of obtaining qualified molybdenum oxide; It is a pixel. Reflectivity; It is the residual baseline, representing the reflectance that a qualified product should have, which is obtained by taking the median of the reflectance residual plot; It is the hyperbolic tangent function; It is a confidence factor. By using the hyperbolic tangent function (tanh) to map the reflectance residual to a confidence score between 0 and 1, this method provides a non-linear and smooth weight for subsequent weighted Gaussian smoothing. Compared to simple linear mapping or hard thresholding, this method can more finely and robustly quantify the probability that each pixel belongs to the qualified product.
[0008] Furthermore, the method for determining the dynamic compensation gain includes: mapping the Euclidean distance between the chromaticity of each pixel and the prior chromaticity to a chromaticity affinity; and adding the product of the chromaticity affinity and the difference between a preset shadow compensation gain and a base compensation gain to the base compensation gain to obtain the dynamic compensation gain. By mapping the Euclidean distance between pixel chromaticity and the prior chromaticity to a chromaticity affinity, this method provides a clear quantitative basis for the selectivity of shadow compensation. It directly links the compensation intensity to the similarity between the pixel color and the standard color; the closer the colors are, the greater the compensation intensity. This ensures that the compensation mechanism can accurately act on the shadow area without mistakenly enhancing the impurity area, thereby enhancing the separation between shadows and impurities.
[0009] Furthermore, the method for constructing the shadow compensation factor includes: adding 1 to the product of the dynamic compensation gain and the hyperbolic tangent of the corresponding value of the clean illumination map to obtain the shadow compensation factor. Combining the dynamic compensation gain with the clean illumination map and again using the hyperbolic tangent function for nonlinear transformation, this construction method allows the compensation factor to not only have chromaticity selectivity but also adaptively adjust according to local illumination intensity, avoiding overcompensation for areas with sufficient brightness. This effectively eliminates shadows while better preserving the overall visual quality and detail information of the image.
[0010] Furthermore, the method for obtaining the prior colorimetric value includes: using the median of each colorimetric channel of the color image as the prior colorimetric value. Compared to using a fixed preset value or mean, the median method is less affected by a few extreme outliers in the image (such as large impurities or highlights), and can more accurately and automatically extract the main color features of the current batch of materials.
[0011] Furthermore, the method for calculating the dynamic reference color difference includes: converting the compensated color image into the CIELab color space; and calculating the color difference of all pixels in the CIELab color space using the CIE Delta E 2000 formula. This method utilizes a color model and color difference measurement standard that is more consistent with human visual perception. Compared to directly calculating distances in non-uniform spaces such as RGB, the color difference values obtained in this way can more realistically reflect the perceptual differences between colors, thereby making the threshold setting for defect judgment more scientific and accurate.
[0012] Furthermore, the set threshold is 30.
[0013] Furthermore, the method also includes: preprocessing the color image using a bilateral filter.
[0014] Furthermore, the grade sorting includes: calculating the proportion of pixels with color difference scores greater than a set threshold to the total number of pixels, and classifying the molybdenum oxide product into multiple grades based on the proportion.
[0015] In a second aspect, the present invention also provides a visual inspection system for grade sorting of molybdenum oxide products, comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the visual inspection method for grade sorting of molybdenum oxide products as described in any of the preceding claims.
[0016] Beneficial effects: First, by calculating the purity confidence score to guide the construction of the pure illumination map, interference from impurity pixels on illumination estimation is avoided. Next, a dynamic compensation gain based on the similarity between pixel chromaticity and prior chromaticity is introduced, making the compensation process selective. This strongly brightens shadow areas with colors consistent with qualified products, while only weakly compensating for impurity areas with abnormal colors. Finally, defect judgment is performed by calculating color difference on the compensated image, thus accurately distinguishing between harmless shadows and real impurity defects. This significantly improves the accuracy and robustness of detection, effectively avoids material waste caused by misjudgment, and improves production efficiency and yield. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the classification of molybdenum oxide according to an embodiment of the present invention. Detailed Implementation
[0018] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0019] like Figure 1 As shown, S101: Acquire images of molybdenum oxide materials and preprocess them.
[0020] First, an image acquisition system is set up. Specifically, a high-speed industrial camera, such as a color CMOS line scan camera, is used in conjunction with a highly uniform light source, such as a shadowless dome light source, to continuously capture images of the molybdenum oxide material on the conveyor belt, obtaining one or more frames of raw two-dimensional color images. These images are typically in RGB format.
[0021] To reduce noise interference introduced by sensors or the environment during subsequent processing, while preserving the edge information of material particles and defect areas, the acquired original two-dimensional color image needs to be preprocessed. Specifically, a bilateral filter can be used to smooth and denoise the image. The bilateral filter can effectively filter out noise while preserving the edge details of the image to the greatest extent possible, avoiding blurring of defect features due to excessive smoothing. After preprocessing, a clear, low-noise, clean two-dimensional color image is obtained, hereinafter referred to as the clean image, which will serve as the basis for subsequent analysis steps.
[0022] S102: Shadow compensation and dynamic reference color calculation based on color perception.
[0023] This step involves a series of calculations to construct and apply a differentiated shadow compensation mechanism to eliminate the interference of shadows on detection and establish a dynamic color difference evaluation standard. The overall construction logic is as follows: First, based on the brightness information of the clean image, a clean illumination map that can accurately reflect the true light intensity on the material surface is constructed; second, combined with the chromaticity information of the clean image, a shadow compensation factor is constructed that responds strongly to shadow areas and weakly to impurity areas; finally, this factor is applied to the original image to eliminate shadows, and a color difference score is calculated on the compensated image to highlight the true impurity defects.
[0024] Regarding the construction of a clean lighting map, it's important to note that when a pixel's brightness value is extremely low, the hue and saturation information it carries becomes unreliable. Therefore, simply relying on chromaticity information to distinguish between shadows and noise is insufficient; a dynamic ambient lighting baseline, i.e., a clean lighting map, needs to be constructed to evaluate the theoretical illumination intensity of each pixel under unshaded conditions. The process of constructing a clean lighting map is as follows.
[0025] First, the clean image obtained in step S101 is converted from the RGB color space to the HSV color space. The HSV space divides color into three components: hue (H), saturation (S), and lightness (V). The V component (i.e., the lightness map) directly reflects the brightness information of a pixel. Since the brightness of a pixel is the product of ambient light and the reflectivity of the object's surface, the distribution of ambient light can be initially estimated by performing Gaussian smoothing on the lightness map to obtain an initial lighting map. However, traditional Gaussian smoothing is an indiscriminate smoothing method, which simultaneously blurs the gradual brightness changes caused by shadows and the abrupt low brightness caused by impurities, resulting in distortion of the final clean lighting map. To solve this problem, this embodiment first uses traditional Gaussian smoothing to convolve the original lightness map to obtain the initial lighting map. Subsequently, according to the physical model, by dividing the brightness value of each pixel by the light intensity at that point, the reflectivity of the object's surface corresponding to that pixel can be obtained, thereby generating a reflectivity residual map. In the shaded areas of qualified products, the calculated reflectance value is higher because molybdenum oxide itself has a high reflectance; while in the impurity areas, the calculated reflectance value is lower because the impurities themselves have low reflectance.
[0026] To quantify the confidence level of each pixel belonging to qualified molybdenum oxide, a purity confidence map was constructed using the reflectance residual map. The construction was based on mapping the values in the reflectance residual map to a range of 0 to 1, with pixels having high reflectance (qualified products) having a confidence level close to 1, and pixels having low reflectance (impurities) having a confidence level close to 0. The formula for constructing the confidence level for each pixel is as follows: In the formula, It is a pixel. The confidence score represents the pixel. The probability of obtaining qualified molybdenum oxide; It is a pixel. Reflectivity; It is the residual baseline, representing the reflectance that a qualified product (including shadows) should have, obtained by taking the median of the reflectance residual plot; It is a confidence factor, in this embodiment, The value is 5, which is used to control the system's sensitivity to the deviation of pixel reflectance from the residual reference. This represents the hyperbolic tangent function.
[0027] From the above formula, it can be seen that when the pixel point reflectivity Much higher than the benchmark At that time, its confidence level Approaching 1; conversely, when far below hour, The value approaches 0. This yields a purity confidence map that quantifies the probability that each pixel is a valid pixel.
[0028] Finally, using the purity confidence map as weights, a weighted Gaussian smoothing is applied to the original brightness map to obtain the final pure illumination map. The calculation formula is as follows: In the formula, It is a pixel. Light intensity under normal conditions; It is a pixel. Neighborhood The first 1 pixel; It is a Gaussian space kernel, at a distance from the pixel. The closer, The value is larger; It is a pixel. Confidence score; The pixels in the original brightness image The brightness value; It is a very small positive number, such as Ensure that the denominator is not 0.
[0029] It is understandable that when the pixels in the neighborhood... When impurities are present, their confidence scores are very low, resulting in a negligible contribution of their brightness values to the weighted average. Therefore, the final pure illumination image accurately reflects the true illumination intensity of the material surface and is largely unaffected by impurity pixels.
[0030] Relying solely on a clean illumination map for compensation will equally brighten shadows and impurities, failing to maximize the distinction between them. Based on prior knowledge, shadows are areas of acceptable products that have darkened due to insufficient lighting, and their chromaticity should be consistent with that of acceptable products, including hue (H) and saturation. Impurities, on the other hand, inherently differ in color from acceptable products. Therefore, a selective shadow compensation factor can be constructed by incorporating chromaticity information.
[0031] First, the prior chromaticity of the molybdenum oxide material is calculated. Specifically, the median values of the H and S channels of the clean image are taken to obtain the prior hue and prior saturation. Next, for each pixel, the deviation between its chromaticity and the prior chromaticity is calculated, i.e., the chromatic distance. The calculation formula is as follows: ; It is a pixel. chromaticity distance, It is a pixel. Hue value; It is a pixel. saturation value; It is a priori hue. It is the a priori saturation.
[0032] Then, the chromaticity distance is mapped to chromaticity affinity, representing the pixel. The degree to which the color closely resembles the color of a qualified product. The calculation formula is as follows: In the formula, It is a pixel. Color affinity, It is a pixel. chromaticity distance, It is the chromaticity brightness coefficient, used to control the system's sensitivity to chromaticity distance. The value is 0.15. This is the function for finding the maximum value. It is the hyperbolic tangent function. From this formula, we can see that in the shadow region, the pixel's chromaticity is highly consistent with the prior chromaticity, and the pixel... The chromaticity distance is very small, causing the chromaticity affinity to approach 1. However, in the nodule region, the pixel's chromaticity differs significantly from the prior chromaticity, and the pixel... The large chromaticity distance makes the chromaticity affinity approach 0.
[0033] Based on chromatic affinity, a dynamic compensation gain is constructed. The calculation formula is as follows: In the formula, It is a pixel. Dynamic compensation gain, This is the basic compensation gain; moderate brightening is helpful for subsequent analysis, and its preferred value is 0.4. It is the shadow compensation gain, representing the maximum compensation expected to be applied to shadows, with a preferred value of 1.2; It is a pixel. Color affinity.
[0034] Finally, by combining the clean lighting map and dynamic compensation gain, the final shadow compensation factor for each pixel is constructed. The calculation formula is as follows: In the formula, It is a pixel. Shadow compensation factor, It is a pixel. Light intensity under normal conditions. It is a pixel. Dynamic compensation gain. It is the compensation sensitivity coefficient, used to control the system's sensitivity to light intensity. In this embodiment, its preferred value is 3.0. It is the hyperbolic tangent function. Through this differential compensation mechanism, for the shaded area, The value increases significantly, resulting in strong compensation; for impurity regions, The increase in the value is very small, resulting in only a slight compensation. This makes the brightness value of the shadow area much higher than that of the impurities, providing greater accuracy for subsequent operations.
[0035] The obtained shadow compensation factor is applied to the original lightness map to obtain the compensated pure lightness map. The calculation formula is as follows: . It is the pixel in the compensated purity and brightness image. brightness value, For the original brightness map pixels brightness value, For pixels The shadow compensation factor. Functions are used to restrict values to a certain range. Within the range.
[0036] The compensated purity image is merged with the original H and S channels, and the compensated HSV image is converted back to RGB space, and then further converted to CIELab color space. In CIELab space, the median of the L* (brightness), a* (redness / greenness), and b* (yellowness / blueness) components of all pixels is calculated as the dynamic reference color of the current material. Subsequently, the color difference between each pixel and this dynamic reference color is calculated using the CIE Delta E2000 formula, resulting in the final color difference score image. In this image, the effectively compensated shadow areas score very low, while the impurity areas that are not significantly brightened score very high.
[0037] S103: Defects are segmented based on color difference score maps.
[0038] After obtaining the color difference score for each pixel using the steps described above, a fixed color difference threshold is set. As a preferred approach, this threshold can be set to 30 based on experience. Any pixel with a color difference score exceeding this threshold is considered a defective pixel.
[0039] By thresholding the color difference score map, a binary defect map can be generated, where defect pixels (i.e., impurities) are marked as foreground and the remaining areas as background. Finally, the system calculates the total area of defect pixels in the binary defect map and determines the final grade of the batch of molybdenum oxide products based on the proportion of the defect area to the total image area. For example, different proportion ranges can be set to correspond to different product grades, such as superior, first-class, qualified, and substandard.
[0040] For example, the grades are as follows: Superior grade: 0% ≤ proportion < 0.1%, almost no visible impurities on the surface, extremely high product purity, and optimal quality. First grade: 0.1% ≤ proportion < 0.5%, contains a very small amount of minute impurities, does not affect main performance characteristics, and is of good quality. Qualified grade: 0.5% ≤ proportion < 1.0%, contains a small amount of visible impurities, and meets basic factory standards. Defective grade: proportion ≥ 1.0%, contains a large amount of impurities, exceeds defect area limits, and is substandard.
[0041] The present invention also provides a visual inspection system for grade sorting of molybdenum oxide products. The system includes a processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the visual inspection method for grade sorting of molybdenum oxide products according to the first aspect of the present invention.
[0042] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and therefore will not be described in detail here.
[0043] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device. Any application or module described in this invention can be implemented using computer-readable / executable instructions stored or otherwise maintained on such a computer-readable medium.
[0044] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A visual inspection method for the classification of molybdenum oxide products, characterized in that, The method comprises: acquiring a color image of the molybdenum oxide product and converting the color image into a color space comprising a luminance channel and at least one chrominance channel; calculating a dynamic reference color difference as a median of color differences of all pixels in the compensated color image, and calculating a color difference score of each pixel with respect to the dynamic reference color difference; and in response to the presence of a color difference score greater than a set threshold, determining that the molybdenum oxide product has defects and performing grade sorting. The reflectivity residual is mapped to a purity confidence score, the calculation method comprising: , is the confidence score of pixel point , indicating the probability of pixel point being qualified molybdenum oxide; is the reflectivity of pixel point ; is the residual reference, representing the reflectivity of the qualified product, obtained by taking the median of the reflectivity residual map; is a hyperbolic tangent function, is a confidence factor; the initial light value is obtained by Gaussian smoothing on the brightness channel; Constructing the pure illumination map, including weighted Gaussian smoothing on the luminance channel to obtain the final pure illumination map, satisfying the relationship , is the pixel point the intensity of the light in the normal case, is the pixel point the neighborhood the first pixel point, is the Gaussian space kernel, is the confidence score of the pixel point , is the luminance value of the pixel point in the original brightness map, is a very small positive number; the weighting coefficient is the purity confidence score; The dynamic compensation gain is determined based on similarity between chrominance of each pixel and preset prior chrominance, including: taking median of H channel and S channel of the pure image to obtain prior hue and prior saturation; calculating chrominance distance, satisfying relationship , is the chrominance distance of pixel point , is the hue value of pixel point , is the saturation value of pixel point , is the prior hue, is the prior saturation; mapping the chrominance distance to chrominance affinity, satisfying relationship , is the chrominance affinity of pixel point , is the chrominance light and dark coefficient, is the maximum value function; constructing the dynamic compensation gain based on the chrominance affinity, satisfying relationship , is the dynamic compensation gain of pixel point , is the basic compensation gain, is the shadow compensation gain; According to the pure light illumination map and the dynamic compensation gain, a shadow compensation factor of each pixel is constructed, and a relationship is satisfied , is a shadow compensation factor of a pixel point , is a compensation sensitivity coefficient; the shadow compensation factor is applied to a luminance channel to obtain a compensated pure brightness map; and the compensated pure brightness map is combined with at least one chroma channel to obtain a compensated color image; The method for calculating the dynamic reference color difference comprises:
2. The visual inspection method for molybdenum oxide product grade sorting according to claim 1, characterized in that, converting the compensated color image into a CIELab color space; and calculating color differences of all pixels in the CIELab color space using a CIE Delta E 2000 formula. The set threshold is 30.
3. The visual inspection method for molybdenum oxide product grade sorting according to claim 1, characterized in that, The method further comprises: pre-processing the color image using a bilateral filter.
4. The visual inspection method for molybdenum oxide product grade sorting of claim 1, wherein, The grade sorting comprises:
5. The visual inspection method for molybdenum oxide product grade sorting of claim 1, wherein, calculating a proportion of a number of pixels with color difference scores greater than the set threshold to a total number of pixels, and sorting the molybdenum oxide product into multiple grades according to the proportion. The memory stores a computer program, and the processor executes the computer program to implement the visual detection method for grade sorting of the molybdenum oxide product according to any one of claims 1-5.
6. A vision inspection system for molybdenum oxide product grade sorting comprising a processor and a memory, characterized in that,
Citation Information
Patent Citations
Preparation method of industrial molybdenum oxide chemical standard sample
CN110887714A
High-precision image processing method and system based on illumination adaptive compensation
CN121032846A