A product indicator light color recognition method, device and system
By using computer vision technology to identify the colors of product indicator lights in the aging chamber, the problem of relying on manual labor for monitoring existing aging chambers has been solved, enabling real-time and accurate monitoring and information feedback, and reducing manual intervention.
Patent Information
- Application Number
- CN202111021675.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-09-01
AI Technical Summary
Existing aging chamber monitoring methods rely on human resources, resulting in slow information feedback and wasted human resources.
By employing computer vision technology, images are preprocessed, grayscaled, binarized, bitwise ANDed, and converted to the HSV color space to identify the color of product indicator lights, reducing manual intervention.
It enables real-time monitoring with low labor costs, improves the accuracy and speed of information feedback, reduces human observation errors, and reduces the pressure on testers.
Smart Images

Figure CN113920057B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision, and in particular to a method, apparatus and system for recognizing the color of a product indicator light. Background Technology
[0002] Electronic products are widely used, but they are composed of various electronic components. After prolonged use, these components will age and deteriorate, causing the product to malfunction. Therefore, it is necessary to conduct aging tests on the electronic components in electronic products to help engineers identify factors that may cause product malfunctions and anticipate potential damage factors that could occur when the product reaches consumers. Aging tests primarily involve placing multiple products in an aging chamber for continuous operation to observe which components exhibit aging problems.
[0003] Existing monitoring methods for aging chambers primarily include camera surveillance, scheduled patrols by testers, and on-site observation by testers. Camera surveillance typically relies on historical playback, which is a continuous drain on operator energy. Furthermore, accessing historical recordings can lead to slow information feedback, indirectly hindering product development. Scheduled patrols and on-site observation by testers require engineers to first guide them with relevant professional knowledge, outlining all key points for observation. While this method allows for timely feedback of useful information to engineers for further development planning, it is also a labor-intensive process. Therefore, existing methods for monitoring aging chambers suffer from a waste of human resources. Summary of the Invention
[0004] This application provides a method for identifying the color of a product indicator light. By using computer vision to analyze the color of the indicator light, the method achieves the identification of the product indicator light color with low labor costs.
[0005] According to one aspect of the embodiments of this application, a method for identifying the color of a product indicator light is provided, comprising:
[0006] Obtain the image to be processed;
[0007] The image to be processed is preprocessed to obtain the product image in the image to be processed;
[0008] The product image is then processed to grayscale and binarize.
[0009] Perform a bitwise AND operation on the product image to obtain the indicator light image;
[0010] The indicator light image is converted to the HSV color space, and the corresponding color of the indicator light image is extracted based on the color of the indicator light.
[0011] Output the indicator light image of the corresponding color.
[0012] Specifically, preprocessing the image to be processed to obtain the product image in the image to be processed includes:
[0013] The image to be processed is then converted to grayscale and binarized.
[0014] By traversing each pixel of the image to be processed row by row, the pixel coordinates of each product can be obtained.
[0015] Filter noise in the image to be processed based on the pixel coordinates;
[0016] Perform a bitwise AND operation between the preprocessed image to be processed and the original image to be processed to obtain the product image in the image to be processed.
[0017] Specifically, the binarization process for the product image includes:
[0018] Determine whether the pixel value of each pixel in the grayscale product image is greater than a preset pixel value. If the pixel value is greater than the preset pixel value, set the pixel value to 255. If the pixel value is less than or equal to the preset pixel value, set the pixel value to 0.
[0019] The method further includes, after performing grayscale and binarization processing on the product image:
[0020] The indicator light image of the corresponding color is subjected to dilation processing, wherein the dilation processing is to expand the white area of the binarized indicator light image of the corresponding color.
[0021] The method further includes, after converting the indicator light image to the HSV color space and extracting the corresponding color of the indicator light image based on the indicator light's color:
[0022] The product image is subjected to dilation processing, wherein the dilation processing is to expand the white area of the binarized product image.
[0023] Specifically, outputting the indicator light image of the corresponding color includes:
[0024] The indicator light image is subjected to grayscale processing, binarization processing, dilation processing, and contour redrawing processing, wherein the dilation processing is to expand the white area of the binarized product image;
[0025] The number of outlines in the indicator light image is obtained;
[0026] The number of devices in the image to be processed is obtained based on the number of outlines in the indicator light image.
[0027] Specifically, outputting the indicator light image of the corresponding color includes:
[0028] The corresponding color indicator light image is subjected to grayscale processing, binarization processing, dilation processing, and contour redrawing processing;
[0029] Obtain the outline of each indicator light in the indicator light image of the corresponding color;
[0030] The product model of each indicator light is determined based on the outline of each indicator light;
[0031] Output the indicator light image of the corresponding color and the product model of each indicator light.
[0032] The format of the output indicator light image of the corresponding color is JSON format.
[0033] According to another aspect of the embodiments of this application, a device for recognizing the color of a product indicator light is provided, comprising:
[0034] The acquisition module is used to acquire the image to be processed;
[0035] The preprocessing module is used to preprocess the image to be processed to obtain the product image in the image to be processed;
[0036] The image processing module is used to perform grayscale and binarization processing on the product image;
[0037] The graphics processing module is used to perform bitwise AND operations on the product image to obtain the indicator light image;
[0038] The image conversion module is used to convert the indicator light image to the HSV color space and extract the indicator light image of the corresponding color according to the color of the indicator light;
[0039] The output module is used to output the indicator light image of the corresponding color.
[0040] According to another aspect of the embodiments of this application, a product indicator light color recognition system is provided, including a network camera, a router, and a computer. The network camera is used to acquire an image to be processed, the router is used to connect the network camera and the computer via data, and the computer is used to run a product indicator light color recognition method.
[0041] The beneficial effects of this invention are as follows: real-time computer calculation reduces the pressure on testers in the aging chamber, eliminating the need for direct product observation; computer processing algorithms can output indicator light recognition results without requiring high image clarity, and the system works normally both day and night; computer processing virtually eliminates errors caused by manual observation and recording, thus improving the accuracy of observation. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 The flowchart of a product indicator light color recognition method provided in this application embodiment Figure 1 ;
[0044] Figure 2 The flowchart of a product indicator light color recognition method provided in this application embodiment Figure 2 ;
[0045] Figure 3 A module connection diagram of a product indicator light color recognition device provided in an embodiment of this application;
[0046] Figure 4 This is a system connection diagram of a product indicator light color recognition system provided in an embodiment of this application. Detailed Implementation
[0047] 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.
[0048] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. 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 includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0049] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0050] After prolonged use, electronic components will age and deteriorate, causing electronic products to malfunction. Therefore, it is necessary to conduct aging tests on the electronic components in electronic products to help engineers identify factors that may cause product malfunctions and anticipate potential damage factors that may occur in the hands of consumers. Aging tests primarily involve placing multiple products in an aging chamber and operating them continuously to observe which components exhibit aging problems.
[0051] Existing monitoring methods for aging chambers primarily include camera surveillance, scheduled patrols by testers, and on-site observation by testers. Camera surveillance typically relies on historical playback, which is a continuous drain on operator energy. Furthermore, accessing historical recordings can lead to slow information feedback, indirectly hindering product development. Scheduled patrols and on-site observation by testers require engineers to first guide them with relevant professional knowledge, outlining all key points for observation. While this method allows for timely feedback of useful information to engineers for further development planning, it is also a labor-intensive process. Therefore, existing methods for monitoring aging chambers suffer from a waste of human resources.
[0052] To address this issue, this application proposes a method, apparatus, and system for identifying the color of a product indicator light, thereby resolving the aforementioned problem.
[0053] Figure 1 The flowchart of a product indicator light color recognition method provided in this application embodiment Figure 1 .like Figure 1 As shown in the embodiment of this application, a method for identifying the color of a product indicator light includes:
[0054] S101, Obtain the image to be processed.
[0055] In this embodiment, acquiring the image to be processed specifically involves using OpenCV's VideoCapture function to capture images from a webcam and storing them in Mat format. Mat format is an image format used by OpenCV since OpenCV3. Programmers can easily access the image type and pixel size by accessing Mat elements and then use this image format to call various OpenCV API functions. Generally, if the input parameter, i.e., the image address, is correct, the image can be obtained using code.
[0056] S102, preprocess the image to be processed to obtain the product image in the image to be processed. The specific steps for preprocessing the image to be processed are as follows: Figure 2 The specific details will be provided in the embodiments and related examples.
[0057] S103, perform grayscale and binarization processing on the product image.
[0058] It should be noted that converting the product image to grayscale specifically involves determining whether the pixel value of each pixel in the grayscale image is greater than a preset pixel value. If the pixel value is greater than the preset pixel value, the pixel value is set to 255; if the pixel value is less than or equal to the preset pixel value, the pixel value is set to 0. The purpose of converting the product image to grayscale is to transform the original color image captured by the camera into a black and white image, facilitating subsequent processing steps. Furthermore, the black and white of each pixel can be changed through preset values, allowing testers to perform tests for different application scenarios.
[0059] S104, Perform a bitwise AND operation on the product image to obtain the indicator light image.
[0060] S105, convert the indicator light image to the HSV color space, and extract the indicator light image of the corresponding color according to the color of the indicator light.
[0061] It should be noted that HSV, like RGB, is also a color space used to represent information in color images. The two can be converted to each other, but HSV better avoids the influence of brightness on color, making it more suitable for color recognition. Therefore, this embodiment uses the HSV color space.
[0062] S106, Output the indicator light image of the corresponding color.
[0063] Optionally, outputting the indicator light image of the corresponding color specifically includes: performing grayscale processing, binarization processing, dilation processing, and contour redrawing processing on the indicator light image, wherein the dilation processing expands the white area of the binarized product image; obtaining the number of contours of the indicator light image; and obtaining the number of devices in the image to be processed based on the number of contours of the indicator light image. After obtaining the positions of the indicator lights of different colors, the contours of the indicator light images can be calculated and marked in the corresponding color indicator light image to check for errors or abnormalities in the image processing, ensuring correct program operation.
[0064] Optionally, outputting the indicator light image of the corresponding color specifically includes: performing grayscale processing, binarization processing, dilation processing, and contour redrawing processing on the indicator light image of the corresponding color; obtaining the contour of each indicator light in the indicator light image of the corresponding color; determining the product model of each indicator light based on the contour of each indicator light; and outputting the indicator light image of the corresponding color and the corresponding product model of each indicator light. After obtaining the contour of each indicator light through the above steps, it can be compared with the different indicator light contours corresponding to different product models that are pre-input. If the comparison is successful, the product model corresponding to a certain indicator light is obtained. Then, the indicator light image of the corresponding color and the corresponding product model of each indicator light are output, so that users can clearly see the product model information corresponding to each indicator light.
[0065] It should be noted that the output of the indicator light image of the corresponding color is in JSON format.
[0066] Figure 2 The flowchart of a product indicator light color recognition method provided in this application embodiment Figure 2 .like Figure 2 As shown in the embodiment of this application, a method for recognizing the color of a product indicator light is provided. Preprocessing is performed to obtain the product image in the image to be processed. Specifically, the method includes:
[0067] S201, perform grayscale and binarization processing on the image to be processed.
[0068] S202, traverse each pixel of the image to be processed row by row to obtain the pixel coordinates of each product.
[0069] In this embodiment, the process of traversing each pixel of the image to be processed row by row to obtain the pixel coordinates of each product is as follows: Each product is connected by a thick line in rows. Based on the arrangement of the products on the test rack, there are N rows of products on the test rack, thus dividing the image into N rows. Each pixel in each row has a corresponding range of horizontal and vertical coordinates. The pixels in each row are traversed from left to right to find the first device in each row. Starting from the first device in each row, all pixels in each row are traversed in the order of top to bottom, then left to right, until the number of devices matches the preset number in the algorithm, thus obtaining the pixel coordinates corresponding to each product.
[0070] S203, filter out noise in the image to be processed based on the pixel coordinates.
[0071] In this embodiment, the image to be processed contains noise, which appears as white spots. The algorithm cannot distinguish between the original image and the noise, therefore the noise needs to be filtered out. Filtering the noise in the image to be processed based on the pixel coordinates specifically involves first obtaining the outline of the graphic in the image through step S202, determining whether the outline is rectangular, and if not, coloring the pixels within the outline black. Then, another step of judgment and blackening is performed to color out smaller white spots, thus eliminating the noise.
[0072] S204, perform a bitwise AND operation between the preprocessed image to be processed and the original image to be processed to obtain the product image in the image to be processed.
[0073] In this embodiment, a bitwise AND operation is performed between the preprocessed image to be processed and the original image to be processed to obtain a color image of the image to be processed, which is convenient for observation and debugging. The preprocessing extracts all the devices to be identified and removes white metal test frames, noise interference, and other background that may affect the recognition rate.
[0074] Figure 3 A module connection diagram of a product indicator light color recognition device provided in this application embodiment is shown below. Figure 3 As shown in the figure, this embodiment proposes a product indicator light color recognition device, comprising: an acquisition module for acquiring an image to be processed; a preprocessing module for preprocessing the image to be processed to obtain a product image in the image to be processed; an image processing module for performing grayscale and binarization processing on the product image; an image operation module for performing bitwise AND operation on the product image to obtain an indicator light image; an image conversion module for converting the indicator light image to the HSV color space and extracting an indicator light image of the corresponding color according to the color of the indicator light; and an output module for outputting the indicator light image of the corresponding color.
[0075] Figure 4A system connection diagram for a product indicator light color recognition system provided in this application embodiment is shown below. Figure 4 As shown in the figure, this embodiment proposes a product indicator light color recognition system, including a network camera, a router, and a computer. The network camera is used to acquire images to be processed, the router is used to connect the network camera and the computer, and the computer is used to run the product indicator light color recognition method described in the above embodiment. Furthermore, as shown in the figure, this embodiment of the product indicator light color recognition system also includes a test rack for a device under test, and the device under test is equipped with a working status indicator light.
[0076] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying 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.
[0077] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for identifying the color of a product indicator light, characterized in that, include: Obtain the image to be processed; The image to be processed is preprocessed to obtain the product image in the image to be processed; The product image is then processed to grayscale and binarize. A bitwise AND operation is performed on the product image before and after grayscale and binarization processing to obtain the indicator light image; The indicator light image is converted to the HSV color space, and the corresponding color of the indicator light image is extracted based on the color of the indicator light. Output the product information of the indicator light image of the corresponding color; wherein, the product information includes the number of devices and the product model; The preprocessing of the image to be processed to obtain the product image in the image to be processed specifically includes: The image to be processed is then converted to grayscale and binarized. By traversing each pixel of the image to be processed row by row, the pixel coordinates of each product can be obtained. Filter noise in the image to be processed based on the pixel coordinates; Perform a bitwise AND operation between the preprocessed image to be processed and the original image to be processed to obtain the product image in the image to be processed. The step of filtering noise in the image to be processed based on the pixel coordinates includes: The outline shape of each product is determined based on the pixel coordinates of each product; Noise in the image to be processed is filtered based on the outline shape of each product.
2. The method for identifying the color of a product indicator light according to claim 1, characterized in that, The binarization process for the product image specifically involves: Determine whether the pixel value of each pixel in the grayscale product image is greater than a preset pixel value. If the pixel value is greater than the preset pixel value, set the pixel value to 255. If the pixel value is less than or equal to the preset pixel value, set the pixel value to 0.
3. The method for identifying the color of a product indicator light according to claim 1, characterized in that, After performing grayscale and binarization processing on the product image, the method further includes: The indicator light image of the corresponding color is subjected to dilation processing, wherein the dilation processing is to expand the white area of the binarized indicator light image of the corresponding color.
4. The method for identifying the color of a product indicator light according to claim 1, characterized in that, After converting the indicator light image to the HSV color space and extracting the corresponding color indicator light image based on the indicator light's color, the method further includes: The product image is subjected to dilation processing, wherein the dilation processing is to expand the white area of the binarized product image.
5. The method for identifying the color of a product indicator light according to claim 1, characterized in that, The product information specifically includes the output of the indicator light image of the corresponding color: The indicator light image undergoes grayscale conversion, binarization, dilation, and contour redrawing. The dilation process involves expanding the white area of the binarized product image. The number of outlines in the indicator light image is obtained; The number of devices in the image to be processed is obtained based on the number of outlines in the indicator light image.
6. The method for identifying the color of a product indicator light according to claim 1, characterized in that, The product information specifically includes the output of the indicator light image of the corresponding color: The corresponding color indicator light image is subjected to grayscale processing, binarization processing, dilation processing, and contour redrawing processing; Obtain the outline of each indicator light in the indicator light image of the corresponding color; The product model of each indicator light is determined based on the outline of each indicator light; Output the indicator light image of the corresponding color and the product model of each indicator light.
7. The method for identifying the color of a product indicator light according to claim 1, characterized in that, The output of the indicator light image of the corresponding color is in JSON format.
8. A device for identifying the color of a product indicator light, characterized in that, include: The acquisition module is used to acquire the image to be processed; The preprocessing module is used to preprocess the image to be processed to obtain the product image in the image to be processed; The image processing module is used to perform grayscale and binarization processing on the product image; The graphics processing module is used to perform a bitwise AND operation on the product image before and after grayscale and binarization processing to obtain the indicator light image; The image conversion module is used to convert the indicator light image to the HSV color space and extract the corresponding color of the indicator light image based on the color of the indicator light. The output module is used to output product information for the corresponding color indicator light image; wherein, the product information includes the number of devices and the product model; The preprocessing of the image to be processed to obtain the product image in the image to be processed specifically includes: The image to be processed is then converted to grayscale and binarized. By traversing each pixel of the image to be processed row by row, the pixel coordinates of each product can be obtained. Filter noise in the image to be processed based on the pixel coordinates; Perform a bitwise AND operation between the preprocessed image to be processed and the original image to be processed to obtain the product image in the image to be processed. The step of filtering noise in the image to be processed based on the pixel coordinates includes: The outline shape of each product is determined based on the pixel coordinates of each product; Noise in the image to be processed is filtered based on the outline shape of each product.
9. A product indicator light color recognition system, characterized in that, The device includes a network camera, a router, and a computer. The network camera is used to acquire images to be processed, the router is used to connect the network camera and the computer, and the computer is used to run the product indicator light color recognition method according to claims 1-7.
Citation Information
Patent Citations
Detection method, detection device, electronic equipment and medium
CN110335273A
Method for automatically detecting equipment state operation
CN112395928A