Color band resistor color extraction method and apparatus, device, and medium

By converting the RGB color image of the color ring resistor into the LAB color image and adjusting the color extraction threshold according to the color type, the problem of insufficient color detection accuracy of the color ring resistor in the prior art is solved, and high-precision color extraction and recognition are achieved.

WO2025118515A1PCT designated stage expired Publication Date: 2025-06-12CHENGDU UNION BIG DATA TECH CO LTD

Patent Information

Application Number
PCT/CN2024/097765
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-04
Filing Date
2024-06-06
Publication Date
2025-06-12

AI Technical Summary

Technical Problem

The prior art lacks the accuracy of color detection of color ring resistors, and it is impossible to effectively identify the color information per ring of color ring resistors of plug-in.

Method used

By obtaining the RGB color image of the target color ring resistor, converting it into a LAB color image, and converting the color types corresponding to the LAB value of each color ring resistor, a color extraction threshold is obtained, and the LAB color image is color extraction process based on this threshold.

Benefits of technology

It improves the accuracy and reliability of color ring resistance detection, and realizes the accurate extraction and identification of color ring resistance color information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097765_12062025_PF_FP_ABST
    Figure CN2024097765_12062025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of image recognition, and disclose a color band resistor color extraction method and apparatus, a device, and a medium, which solve the technical problem in the prior art of poor precision of color band resistor color detection. The color band resistor color extraction method comprises: acquiring an RGB color image of a target color band resistor; acquiring an LAB color image on the basis of the RGB color image; performing transformation processing on an LAB value corresponding to each color type of the color band resistor to acquire a color extraction threshold; and performing color extraction processing on the LAB color image on the basis of the color extraction threshold. The method of the present application effectively improves the precision of color band resistor color detection.
Need to check novelty before this filing date? Find Prior Art

Description

A color ring resistor color extraction method, device, equipment and medium Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a method, device, equipment and medium for extracting the color of a color ring resistor. Background Art

[0002] Industrial manufacturing processes can produce a wide variety of defects due to process fluctuations, machine differences, and other factors, requiring significant manual effort to identify and classify these defects. In the Industry 2.0 era, a growing number of electronics manufacturers are adopting artificial intelligence (AI)-based automatic defect classification systems (ADCs) to replace manual defect classification. However, in the field of industrial PCB inspection, plug-in color ring resistors require color information for each ring. Misaligned rings result in component errors, and using ADCs alone to inspect components is insufficient to meet these requirements.

[0003] Summary of the Invention

[0004] The embodiments of the present application provide a method, device, equipment, and medium for extracting the color of a color ring resistor, which solves the technical problem of insufficient accuracy in color ring resistor color detection in the prior art.

[0005] In one aspect, an embodiment of the present application provides a method for extracting color from a color ring resistor, comprising:

[0006] Get the RGB color image of the target color ring resistor;

[0007] Based on the RGB color image, obtaining a LAB color image;

[0008] The color type of each color ring resistor is converted into the corresponding LAB value to obtain the color extraction threshold;

[0009] Based on the color extraction threshold, color extraction processing is performed on the LAB color image.

[0010] As some optional implementations of the present application, the color type of each color ring resistor is converted into a corresponding LAB value to obtain a color extraction threshold, including:

[0011] Input the RGB color image of the target color ring resistor into the trained target color extraction model to obtain the color type of each color ring resistor;

[0012] Based on the color type of each color ring resistor, the LAB value corresponding to the color type of each color ring resistor is transformed to obtain a color extraction threshold.

[0013] Based on the above steps, the accuracy, stability and adaptability of color extraction in subsequent color extraction can be improved.

[0014] As some optional implementations of the present application, based on the color type of each color ring resistor, the LAB value corresponding to the color type of each color ring resistor is transformed to obtain a color extraction threshold, including:

[0015] Based on the color type of each color ring resistor, the LAB value corresponding to each color ring color is transformed by ±10% to obtain a color extraction threshold.

[0016] Based on the above steps, the ±10% LAB value conversion process takes into account a certain range of color variation; this setting can increase the fault tolerance of color extraction, thereby coping with some color changes or manufacturing differences without losing recognition accuracy, that is, reducing the false alarm rate.

[0017] As some optional implementations of the present application, the target color extraction model is trained by the following steps:

[0018] Build the initial ADC color extraction model;

[0019] Training the initial ADC color extraction model based on the first component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor;

[0020] The first component sample image set includes a plurality of first component sample images, and the first component sample images include color type marking information of color ring resistors.

[0021] As some optional implementations of the present application, the training of the initial ADC color extraction model based on the first component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor includes:

[0022] Obtaining an initial image of a component sample;

[0023] Marking the color type of the color ring resistor in the initial component sample image to obtain a first component sample image;

[0024] Based on the first component sample images, obtaining a first component sample image set;

[0025] An initial ADC color extraction model is trained based on the first component sample image set, so that the initial ADC color extraction model outputs the color type of the color ring resistor.

[0026] Based on the above steps, by building and training the target color extraction model, the color type of the color ring resistor is automatically recognized, which improves the recognition efficiency and accuracy.

[0027] As some optional implementations of the present application, after performing color extraction processing on the LAB color image based on the color extraction threshold, the method further includes:

[0028] Based on the color extraction threshold, performing color extraction processing on the LAB color image to obtain color areas of each color ring;

[0029] Based on each of the color wheel color areas, mask processing is performed on the LAB color image.

[0030] Based on the above steps, the results of color extraction are further optimized, and the accuracy and reliability of color extraction are improved.

[0031] As some optional implementations of the present application, obtaining an RGB color image of a target color ring resistor includes:

[0032] Input the component image into the trained object detection model to obtain the position coordinate information of the target color ring resistor;

[0033] Based on the position coordinate information of the target color ring resistor, the component image is cropped to obtain a target color ring resistor image;

[0034] The target color ring resistor image is mapped to the RGB color space to obtain an RGB color image.

[0035] Based on the above steps, the RGB color image of the target color ring resistor is obtained, providing high-quality, accurate, and clean image data, which facilitates the subsequent color extraction and analysis steps, thereby improving the accuracy and reliability of color ring resistor color recognition.

[0036] As some optional implementations of the present application, the target detection model is trained by the following steps:

[0037] Build an initial ADC detection model;

[0038] Training the initial ADC detection model based on the second component sample image set so that the initial ADC detection model outputs position information of the color ring resistor;

[0039] The second component sample image set includes a plurality of second component sample images, and the second component sample images include position marking information of the color ring resistor.

[0040] Based on the above steps, the automatic detection of the color ring resistor position is achieved, which improves the efficiency and accuracy of the detection.

[0041] As some optional implementations of the present application, the training of the initial ADC detection model based on the second component sample image set so that the initial ADC detection model outputs position information of the color ring resistor includes:

[0042] Obtaining an initial image of a component sample;

[0043] Marking the position information of the color ring resistor in the initial component sample image to obtain a second component sample image;

[0044] Based on the second component sample images, obtaining a second component sample image set;

[0045] The initial ADC detection model is trained based on the second component sample image set, so that the initial ADC detection model outputs position information of the color ring resistor.

[0046] Based on the above steps, the automatic detection of the color ring resistor position is realized, which improves the efficiency and accuracy of the detection.

[0047] As some optional implementations of the present application, the second component sample image is acquired by capturing the image from above the component using multiple image capture devices.

[0048] Based on the above steps, using multiple image acquisition devices to capture a second component sample image from above the component provides comprehensive information, multi-angle viewing angles, information fusion, reduced viewing angle restrictions, and increased data diversity. This helps improve the quality and diversity of image data, which in turn has a positive impact on subsequent data processing and analysis steps, such as color extraction of color ring resistors and target detection.

[0049] In another aspect, an embodiment of the present application provides a color ring resistor color extraction device, comprising:

[0050] An image acquisition module is used to acquire an RGB color image of a target color ring resistor;

[0051] A color space conversion module, configured to obtain a LAB color image based on the RGB color image;

[0052] The extraction threshold setting module is used to convert the color type of each color ring resistor into the corresponding LAB value to obtain the color extraction threshold;

[0053] The color extraction processing module is used to perform color extraction processing on the LAB color image based on the color extraction threshold.

[0054] On the other hand, an embodiment of the present application provides an electronic device, including: a memory and a processor, wherein the memory stores an acquisition machine program, and the processor executes the acquisition machine program to implement the aforementioned method.

[0055] On the other hand, an embodiment of the present application provides an acquisition machine-readable storage medium, on which an acquisition machine program is stored, and the processor executes the acquisition machine program to implement the aforementioned method.

[0056] Compared to the prior art, the color extraction method for color ring resistors described in the embodiments of this application, after acquiring the RGB color image of the target color ring resistor, converts the color space from RGB to LAB to obtain a LAB color image; then transforms the color type of each color ring resistor into the corresponding LAB value to obtain a color extraction threshold; and based on the color extraction threshold, performs color extraction on the LAB color image. Specifically, the method described in this application maps the RGB color image of the target color ring resistor from the RGB color space to the LAB color space, then matches and post-processes the color ring resistor image using system-preset color template information, thereby extracting color information from the color ring resistor and improving the accuracy of color ring resistor color detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0058] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0059] FIG2 is a flow chart of a method for extracting color from a color ring resistor provided in an embodiment of the present application;

[0060] FIG3 is a schematic structural diagram of a color ring resistor color extraction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0062] Industrial manufacturing processes can produce a wide variety of defects due to process fluctuations, machine differences, and other factors, requiring significant manual effort to identify and classify these defects. In the Industry 2.0 era, a growing number of electronics manufacturers are adopting artificial intelligence (AI)-based automatic defect classification systems (ADCs) to replace manual defect classification. However, in the field of industrial PCB inspection, plug-in color ring resistors require color information for each ring. Misaligned rings result in component errors, and using ADCs alone to inspect components is insufficient to meet these requirements.

[0063] Specifically, color-ring resistors are designed with a color band painted on the resistor package (i.e., the surface of the resistor) to represent the resistor's resistance value. Therefore, a single color-ring resistor may have multiple colors. The color bands were originally a standard established to help people distinguish different resistance values. For example, the color-ring resistor identification method uses four, five, or six color bands to represent the resistor value. This allows the color information representing the resistance value to be read simultaneously from any angle. However, in practice, the arrangement of some color-ring resistors is not clear, making it easy to misread. Therefore, a high-precision color-ring resistor color extraction method is urgently needed to facilitate repairers in practical applications. This method allows for faster and more accurate color identification of color-ring resistors, allowing them to determine their resistance value based on color, facilitating inspection and replacement. Color-ring resistors are a common type of electronic component, and their color is often used to identify their resistance value. In electronics manufacturing and maintenance, quickly and accurately identifying and extracting the color type and location information of color-ring resistors is crucial for determining resistance values ​​and maintaining electronic equipment. Traditional methods typically involve manual inspection and identification, which is time-consuming, labor-intensive, and prone to errors. Therefore, an automated method is needed to extract the color type and position information of color ring resistors to improve the efficiency of electronic device manufacturing and maintenance.

[0064] Based on the above problems, in order to improve the accuracy of the extracted color ring colors, the embodiment of the present application proposes the following solution: after obtaining the RGB color image of the target color ring resistor, the color space is converted from RGB to LAB to obtain a LAB color image; and the color type of each color ring resistor is transformed into the corresponding LAB value to obtain a color extraction threshold; based on the color extraction threshold, the LAB color image is subjected to color extraction processing.

[0065] Refer to Figure 1, which is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiment of the present application.

[0066] As shown in Figure 1, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0067] Those skilled in the art will appreciate that the structure shown in FIG1 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0068] As shown in FIG1 , the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a color extraction device for a color ring resistor.

[0069] In the electronic device shown in Figure 1, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present application can be set in the electronic device, and the electronic device calls the color ring resistor color extraction device stored in the memory 1005 through the processor 1001 and executes the color ring resistor color extraction method provided in the embodiment of the present application.

[0070] Referring to FIG2 , an embodiment of the present application provides: a method for extracting the color of a color ring resistor, comprising the following steps:

[0071] Step S10: Acquire the RGB color image of the target color ring resistor.

[0072] It should be noted that the RGB color image of the target color ring resistor refers to an image that has been cropped based on the position information of the color ring resistor, so as to reduce interference from images in other areas during subsequent color extraction; it is specifically obtained by the following steps: inputting the component image into a trained target detection model to obtain the position coordinate information of the target color ring resistor; cropping the component image based on the position coordinate information of the target color ring resistor to obtain the target color ring resistor image; mapping the target color ring resistor image to the RGB color space to obtain an RGB color image.

[0073] In practical applications, the object detection model is trained through the following steps: constructing an initial ADC detection model; and training the initial ADC detection model based on a second set of component sample images, so that the initial ADC detection model outputs the location information of the color ring resistor. The second set of component sample images includes multiple second component sample images, each of which includes the location information of the color ring resistor. When the object detection model trained through these steps is put into practical application, it can quickly output the location information of the color ring resistor when capturing an image containing the color ring resistor.

[0074] Specifically, in practical applications, in order to improve the training efficiency of the initial ADC detection model, the embodiment of the present application describes training the initial ADC detection model based on a second component sample image set so that the initial ADC detection model outputs the position information of the color ring resistor, including: obtaining an initial image of the component sample; marking the position information of the color ring resistor in the initial image of the component sample to obtain a second component sample image; obtaining a second component sample image set based on the second component sample image; and training the initial ADC detection model based on the second component sample image set so that the initial ADC detection model outputs the position information of the color ring resistor.

[0075] It should be noted that in this application, acquiring an RGB color image of the target color ring resistor is the first step in color extraction. In addition to traditional single-image acquisition devices, it is possible to consider using multiple image acquisition devices to simultaneously capture the target color ring resistor. For example, multiple cameras or sensor arrays can be used to obtain images from different angles and lighting conditions. This multi-source image acquisition can provide more information, helping to improve the accuracy and stability of color extraction. In further solutions, high-resolution image acquisition devices can also be used to capture richer color details and information, thereby improving the accuracy of color extraction. High-resolution images can better distinguish different color regions on the color ring resistor, especially when subtle color differences exist. Alternatively, autofocus and white balance technologies can be used to ensure image clarity and color balance, especially under varying lighting conditions. This helps reduce the impact of environmental factors on color extraction, making the extracted color information more reliable. After acquiring the original image, image enhancement techniques such as denoising, sharpening, and contrast enhancement can be used to improve image quality and better represent the color characteristics of the color ring resistor. These techniques can be applied after image acquisition or during real-time processing.

[0076] If the second component image is acquired from above the component using multiple image acquisition devices, that is, when applied to quality control on an automated production line, the image acquisition and color extraction processes can be combined into a real-time system so that the results can be obtained immediately after color extraction. This is very useful for applications that require rapid detection and identification of color ring resistors.

[0077] Of course, you can also consider using deep learning techniques, such as convolutional neural networks (CNNs), to train the model to improve the detection and recognition capabilities of the target color ring resistor. Deep learning can automatically learn and extract key features in the image, thereby improving the accuracy and robustness of color extraction; this will be reflected in subsequent steps.

[0078] Through the above technical solutions, the quality and efficiency of obtaining the RGB color image of the target color ring resistor can be further improved, thereby enhancing the performance and practicality of the entire color ring resistor color extraction method; these technologies can be selected and combined according to specific application requirements.

[0079] Step S20: Obtain a LAB color image based on the RGB color image.

[0080] In the embodiment of the present application, a key step is to obtain a LAB color image based on the acquired RGB color image; this step is of great significance in the color extraction method of the color ring resistor because the LAB color space can better represent color information, making the subsequent color extraction processing more accurate and reliable.

[0081] Specifically, the above steps first use a suitable image acquisition device or sensor to acquire an RGB color image of the target color ring resistor. This image is a color image, in which each pixel consists of the values ​​of the red (R), green (G), and blue (B) channels.

[0082] The RGB image is then converted to the LAB color space. This conversion uses the LAB color space in color science (L represents brightness, A represents the color channel from green to red, and B represents the color channel from blue to yellow). This conversion is based on the standards of the International Commission on Illumination (CIE) and better reflects the human eye's perception of color.

[0083] Therefore, the significance of the above color conversion process lies in: a. Color information separation, that is, the LAB color space separates brightness information (L channel) from color information (A and B channels), which helps to accurately extract color features from the image without being disturbed by brightness changes. b. Human eye perception relevance, that is, the coordinate values ​​of the LAB color space are more consistent with the human eye's perception of color, which means that color analysis performed in the LAB space is more consistent with human visual perception. c. Color contrast enhancement, that is, the A and B channels of the LAB color space allow different colors to be distinguished more easily, which improves the accuracy of color extraction, especially when there are subtle differences between the color types of color ring resistors. d. Ambient lighting change robustness, that is, the LAB color space mitigates the impact of ambient lighting changes on color extraction because brightness (L channel) is separated from color information (A and B channels).

[0084] Therefore, the step of obtaining a LAB color image based on the RGB color image is a key step in the color ring resistor color extraction method. It helps improve the accuracy, stability, and reliability of color extraction, making the subsequent extraction of color type and position information more precise and effective. Through this step, we can better understand and utilize the color information of the target color ring resistor, thereby achieving the objectives of this application.

[0085] Step S30 : performing conversion processing on the color type of each color ring resistor corresponding to the LAB value to obtain a color extraction threshold.

[0086] In practical applications, adaptive color models can be developed to model colors based on different scenarios or lighting conditions. Such adaptive models can adjust color extraction thresholds based on color variations in the actual environment to improve the robustness of color extraction. For example, machine learning algorithms can be used to automatically learn color distributions in different environments to obtain more appropriate color extraction thresholds. Alternatively, color correction techniques can be used to ensure that the acquired LAB color values ​​are consistent under different lighting conditions. This can be achieved by correcting parameters such as white balance, brightness, and saturation, thereby improving the accuracy of color extraction.

[0087] Of course, in addition to the LAB color space, in other embodiments, other color spaces may also be considered, such as HSV (hue, saturation, value) or LCH (lightness, chroma, hue). Different color spaces can produce different effects on color information extraction, and the most appropriate color space can be selected based on specific application requirements.

[0088] In specific implementations, the technical solution described in this application considers the use of a dynamic threshold adjustment method to automatically adjust the color extraction threshold based on the color characteristics of different target color wheel resistors. This allows for real-time optimization based on the color information in the actual image. Alternatively, the system can allow users to perform interactive color correction to manually adjust the color extraction threshold or correct the color recognition results, thereby improving the system's flexibility and user-friendliness.

[0089] Through the above technical solution, the accuracy and robustness of color extraction can be further improved, making the color extraction method of the color ring resistor in this application more suitable for different environments and application scenarios.

[0090] In a specific application, the color type of each color ring resistor is converted to a corresponding LAB value to obtain a color extraction threshold, including: inputting the RGB color image of the target color ring resistor into a trained target color extraction model to obtain the color type of each color ring resistor; based on the color type of each color ring resistor, converting the LAB value corresponding to the color type of each color ring resistor to obtain a color extraction threshold.

[0091] When the LAB value corresponding to the color type of each color ring resistor is transformed based on the color type of each color ring resistor to obtain the color extraction threshold, the LAB value corresponding to each color ring color can be transformed by ±10% based on the color type of each color ring resistor to obtain the color extraction threshold.

[0092] It should be noted that the trained target color extraction model described in the present application can be constructed using a deep learning method, such as a convolutional neural network (CNN); the deep learning model can automatically learn features in the image, thereby improving the recognition performance of the color type. Through large-scale training and data enhancement, the model can better adapt to the color changes of resistors with different color rings. Or using the transfer learning method, a neural network model that has been trained on large-scale data (such as a model on ImageNet) can be used as an initial model, and then fine-tuned to adapt to the target color extraction task. This method can reduce training time and data requirements while improving the performance of the model. Or combine traditional color classification algorithms, such as k-means clustering or support vector machines, to work in conjunction with deep learning models. Such a combined method can improve the accuracy of color types, especially when there is overlap or similarity between color categories.

[0093] Specifically, the target color extraction model described in the embodiment of the present application is obtained by training through the following steps: constructing an initial ADC color extraction model; training the initial ADC color extraction model based on a first component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor; wherein the first component sample image set includes multiple first component sample images, and the first component sample images include color type annotation information of the color ring resistor.

[0094] The first component sample image set can be obtained through data augmentation to increase the diversity and quantity of sample data, thereby improving model performance. This can be achieved through random rotation, scaling, cropping, and brightness and contrast adjustments to generate more training samples. This helps the model better adapt to the color types and variations of various color wheel resistors.

[0095] Specifically, the training of the initial ADC color extraction model based on the first component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor includes: obtaining an initial component sample image; marking the color type of the color ring resistor in the initial component sample image to obtain a first component sample image; obtaining a first component sample image set based on the first component sample image; and training the initial ADC color extraction model based on the first component sample image set so that the initial ADC color extraction model outputs color type information of the color ring resistor.

[0096] However, it should be noted that in addition to the first component sample image set mentioned above, it is also possible to consider obtaining sample data from multiple different sources to cover a wider range of color ring resistor color types and variations; this can include sample data from different suppliers, different manufacturing batches, or different environmental conditions.

[0097] The goal of the aforementioned labeling process is to quickly and accurately label resistors using color coding. Both automatic and semi-automatic labeling tools are suitable, primarily to reduce the workload of manual labeling. However, before actually training the model, data cleaning and preprocessing should be performed to remove noise, correct label errors, and fill in missing data. Ensuring the quality of the sample data is crucial to model performance.

[0098] Through the above technical solution, the process of training the initial ADC color extraction model can be continuously improved so that it can more accurately output the color type information of the color ring resistor.

[0099] Step S40: Perform color extraction processing on the LAB color image based on the color extraction threshold.

[0100] As described above, the color extraction threshold can be obtained by inputting an adaptive color extraction threshold, that is, dynamically adjusting the threshold according to the specific situation of each color ring resistor and the surrounding environment; this can be achieved by analyzing the local color distribution, lighting conditions and background information to improve the robustness of color extraction.

[0101] In some optimization technology solutions, in addition to extracting color information, it is also possible to consider extracting the shape and texture features of the color ring resistor to help repairers identify the color ring resistor more quickly, such as through edge detection, texture analysis or shape description.

[0102] The above-mentioned color extraction threshold is not limited to a single threshold. In some embodiments, in order to obtain more reliable extraction results, it is possible to consider using multiple thresholds to extract color information. For example, different thresholds can be used to detect the presence of different color rings, and then the final color is determined by combination.

[0103] Through the above technical solution, the accuracy and robustness of color extraction can be continuously improved, making the color extraction method of the color ring resistor described in this application more suitable for different environments and application scenarios.

[0104] In some embodiments, after the LAB color image is subjected to color extraction processing based on the color extraction threshold, the method further includes: performing color extraction processing on the LAB color image based on the color extraction threshold to obtain each color ring color area; and performing mask processing on the LAB color image based on each color ring color area.

[0105] It should be noted that after obtaining the color regions of each color wheel, these regions can be further segmented to isolate the color portion of each color wheel to ensure accurate color extraction and recognition. Alternatively, color classification and recognition methods can be used to identify each individual color wheel region as a specific color type. This can be achieved by training a classifier, such as a support vector machine, a deep learning model, or traditional color histogram matching.

[0106] It should be noted that the adaptability to multiple lighting conditions should be considered when processing the mask. For example, under different lighting conditions, the color may change, so illumination correction technology can be used to adjust the color recognition results. The above technical solution can improve the accuracy, stability and usability of color extraction.

[0107] It can be seen that the technical solution described in the embodiment of the present application has the following beneficial effects compared with the existing technology: First, traditional color extraction methods are often affected by light, shadow and environmental interference, which can easily lead to inaccurate color extraction. The technology of the present application adopts LAB color space and multi-channel color information, which can more accurately capture and identify the color of color ring resistors and improve the accuracy of color extraction. Secondly, traditional color extraction of color ring resistors usually requires manual intervention and parameter adjustment, which is time-consuming and unstable. The technology of the present application utilizes target model detection and threshold setting to realize automated color extraction processing, reduce the need for manual operation, and improve efficiency. Furthermore, the technology of the present application introduces a real-time feedback mechanism that can dynamically adjust the color extraction threshold at runtime to adapt to changing color conditions, which enables the color extraction of color ring resistors to more stably cope with uncertainties in the real world.

[0108] In summary, the color ring resistor color extraction technology proposed in this application has significant advantages over traditional technologies in terms of accuracy, automation, generalization, and real-time performance. This makes this technology promising and valuable in applications such as industrial production, quality control, and automation.

[0109] Referring to FIG. 3 , based on the same inventive concept, an embodiment of the present application further provides: a color ring resistor color extraction device, comprising:

[0110] An image acquisition module is used to acquire an RGB color image of a target color ring resistor;

[0111] A color space conversion module, configured to obtain a LAB color image based on the RGB color image;

[0112] The extraction threshold setting module is used to convert the color type of each color ring resistor into the corresponding LAB value to obtain the color extraction threshold;

[0113] The color extraction processing module is used to perform color extraction processing on the LAB color image based on the color extraction threshold.

[0114] It should be noted that the modules in the color ring resistor color extraction device in this embodiment correspond one-to-one to the steps in the color ring resistor color extraction method in the aforementioned embodiment. Therefore, the specific implementation and technical effects achieved by this embodiment can refer to the implementation of the aforementioned color ring resistor color extraction method and will not be repeated here.

[0115] In addition, in one embodiment, the present application also provides an acquisition machine storage medium, on which an acquisition machine program is stored. When the acquisition machine program is executed by a processor, the steps of the method in the aforementioned embodiment are implemented.

[0116] In some embodiments, the acquisition machine-readable storage medium may be a memory device such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface mount storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The acquisition machine may be various acquisition devices including smart terminals and servers.

[0117] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in an acquisition environment.

[0118] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0119] As an example, the executable instructions may be deployed to be executed on one acquisition device, or on multiple acquisition devices located at one site, or on multiple acquisition devices distributed across multiple sites and interconnected by a communication network.

[0120] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0121] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the acquisition machine software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk), including a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, acquisition machine, television receiver, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0123] The above disclosure is only a partial embodiment of the present application, and it is certainly not intended to limit the scope of the rights of the present application. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made in accordance with the claims of the present application are still within the scope of the invention.

Claims

1. A method for extracting color from a color ring resistor, characterized in that: The following steps are involved: Get the RGB color image of the target color ring resistor; Based on the RGB color image, obtain a LAB color image; Input the RGB color image of the target color ring resistor into the trained target color extraction model to obtain the color type of each color ring resistor; based on the color type of each color ring resistor, transform the LAB value corresponding to the color type of each color ring resistor to obtain a color extraction threshold; wherein the color extraction threshold is obtained through an adaptive color model; the color extraction threshold changes with the color in the actual environment; The target color extraction model is obtained by training through the following steps: constructing an initial ADC color extraction model; training the initial ADC color extraction model based on a first component sample image set and a second component sample image set, so that the initial ADC color extraction model outputs the color type of each color ring resistor and the position information of the color ring resistor; wherein the first component sample image set includes a plurality of first component sample images, and the first component sample image includes the color type annotation information of the color ring resistor; the second component sample image set includes a plurality of second component sample images, and the second component sample image includes the position annotation information of the color ring resistor; the first component sample image set is obtained by data enhancement; the data enhancement includes random rotation, scaling, cropping, brightness and contrast adjustment; Based on the color extraction threshold, color extraction processing is performed on the LAB color image.

2. The color extraction method of color ring resistor according to claim 1, characterized in that: The method of transforming the LAB value corresponding to the color type of each color ring resistor based on the color type of each color ring resistor to obtain a color extraction threshold value includes: Based on the color type of each color ring resistor, the LAB value corresponding to each color ring color is transformed by ±10% to obtain a color extraction threshold.

3. The color extraction method of color ring resistor according to claim 1, characterized in that: The training of the initial ADC color extraction model based on the first component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor includes: Obtaining an initial image of a component sample; Marking the color type of the color ring resistor in the initial component sample image to obtain a first component sample image; Based on the first component sample images, obtaining a first component sample image set; The initial ADC color extraction model is trained based on the first component sample image set, so that the initial ADC color extraction model outputs the color type of the color ring resistor.

4. The color extraction method of color ring resistor according to claim 1, characterized in that: After performing color extraction processing on the LAB color image based on the color extraction threshold, the method further includes: Based on the color extraction threshold, performing color extraction processing on the LAB color image to obtain color areas of each color ring; Based on each of the color wheel color regions, mask processing is performed on the LAB color image.

5. The color extraction method of color ring resistor according to claim 1, characterized in that: Get the RGB color image of the target color ring resistor, including: Input the component image into the trained target detection model to obtain the position coordinate information of the target color ring resistor; Based on the position coordinate information of the target color ring resistor, the component image is cropped to obtain a target color ring resistor image; The target color ring resistor image is mapped to the RGB color space to obtain an RGB color image.

6. The color extraction method of color ring resistor according to claim 5, characterized in that: The target detection model is trained by the following steps: Build an initial ADC detection model; Training the initial ADC detection model based on the second component sample image set so that the initial ADC detection model outputs position information of the color ring resistor; The second component sample image set includes a plurality of second component sample images, and the second component sample images include position marking information of color ring resistors.

7. The method for extracting color from a color ring resistor according to claim 6, characterized in that: The training of the initial ADC detection model based on the second component sample image set so that the initial ADC detection model outputs the position information of the color ring resistor includes: Obtaining an initial image of a component sample; Marking the position information of the color ring resistor in the initial component sample image to obtain a second component sample image; Based on the second component sample images, obtaining a second component sample image set; The initial ADC detection model is trained based on the second component sample image set, so that the initial ADC detection model outputs position information of the color ring resistor.

8. The method for extracting color from a color ring resistor according to claim 6, characterized in that: The second component sample image is acquired by capturing images from above the components using a plurality of image capturing devices.

9. A color ring resistor color extraction device, characterized in that: include: An image acquisition module is used to acquire an RGB color image of a target color ring resistor; A color space conversion module, used for obtaining a LAB color image based on the RGB color image; An extraction threshold setting module is used to input the RGB color image of the target color ring resistor into the trained target color extraction model to obtain the color type of each color ring resistor; based on the color type of each color ring resistor, the LAB value corresponding to the color type of each color ring resistor is transformed to obtain a color extraction threshold; wherein the color extraction threshold is obtained through an adaptive color model; the color extraction threshold changes with the color change in the actual environment; wherein the target color extraction model is obtained by training through the following steps: constructing an initial ADC color extraction model; training the initial ADC color extraction model based on a first component sample image set and a second component sample image set so that the initial ADC color extraction model outputs the color type of each color ring resistor and the position information of the color ring resistor; wherein the first component sample image set includes a plurality of first component sample images, and the first component sample image includes the color type annotation information of the color ring resistor; the second component sample image set includes a plurality of second component sample images, and the second component sample image includes the position annotation information of the color ring resistor; the first component sample image set is obtained through data enhancement; the data enhancement includes random rotation, scaling, cropping, brightness and contrast adjustment; A color extraction processing module is used to process the LAB color image based on the color extraction threshold. Row color extraction processing.

10. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein the memory stores an acquisition machine program, and the processor executes the acquisition machine program to implement the method as described in any one of claims 1-8.

11. A machine-readable storage medium, characterized in that: An acquisition machine program is stored on the acquisition machine readable storage medium, and the processor executes the acquisition machine program to implement the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Color ring resistor detection method and device and automatic optical detection system

    CN106529572A

  • Color recognition method, device and equipment and storage medium

    CN112489143A

  • Color circle resistor resistance value detection method based on vision

    CN116245793A

  • Color ring resistance color extraction method, device, equipment and medium

    CN117351100A

  • Device for reading resistor value with computer vision and method thereof

    US20170221200A1

Cited By

  • Equipment state recognition system

    CN121074340A

  • Detection method, detection device and production equipment of gravure aluminum foil for battery

    CN121595484A