A method and device for identifying a substation respirator based on color gamut extraction and segmentation

By performing color gamut extraction and segmentation processing on the RGB image of the substation respirator to identify its effectiveness, the problem of low manual inspection efficiency is solved, automated respirator status monitoring is realized, and work efficiency and the stability of the main transformer are improved.

CN114067115BActive Publication Date: 2024-09-13FUJIAN STRAIT ZHIHUI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111387138.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2024-09-13
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

Manual inspection of substation respirator status maintenance workload is heavy and inefficient, and respirator failure cannot be identified in time, affecting the stable operation of the main transformer.

Method used

A substation respirator identification method based on color gamut extraction and segmentation is used to calculate the pixel ratio and total score of the white part by normalizing, preprocessing, HSV color space conversion, segmentation and binary color gamut segmentation of the original RGB image. , determine the effectiveness of the respirator based on the preset threshold.

Benefits of technology

The respirator status can be accurately identified without regular manual inspection, which improves work efficiency, reduces the workload of maintenance personnel, and ensures stable operation of the main transformer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067115B
    Figure CN114067115B
Patent Text Reader

Abstract

The present application relates to a method for identifying a substation respirator based on color gamut extraction and segmentation. The method first normalizes the original RGB image containing the substation respirator and adjusts the image size to a fixed value, then preprocesses the image, and then converts the preprocessed RGB image into an HSV color space image, and then segments the HSV color space image to form a number of sub-images, and then performs binary color gamut segmentation on the sub-images to obtain a number of binary MASKs, and then scores the white part in the binary MASK, and then counts the total score of the white part in all the binary MASKs in the sub-image list, and compares the total score based on a preset third threshold and outputs the identification result. At the same time, the present application also proposes a substation respirator identification device based on color gamut extraction and segmentation, which has the effect of improving the efficiency of identifying substation respirators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of substation respirator identification, and in particular to a substation respirator identification method and device based on color gamut extraction and segmentation. Background Art

[0002] The respirator, also known as the desiccant, is an auxiliary safety protection device for the main transformer. The respirator absorbs moisture, dew and other water around the main transformer through its own adsorbent and other materials, thereby protecting the safety of the main transformer. Because the respirator has its own service life, when it cannot function, it will change color on the surface. The surface of the respirator in a normal state is white. When it cannot function, the color of the respirator surface changes from white to red. In order to ensure that the main transformer operates stably without interference, the maintenance personnel of the substation need to conduct regular manual inspections. However, manual inspections not only require a large maintenance workload, but also have low work efficiency. Summary of the invention

[0003] In view of the above-mentioned problem that manual inspection of respirator status not only has a large maintenance workload but also has low work efficiency, the present application proposes a substation respirator identification method and device based on color gamut extraction and segmentation.

[0004] In the first aspect, the present application proposes a method for identifying a substation respirator based on color gamut extraction and segmentation, comprising the following steps:

[0005] S1: normalize the original RGB image containing the substation respirator and adjust the image size to a fixed value to obtain a fixed-size RGB image;

[0006] S2: performing contrast enhancement and chroma enhancement on the fixed-size RGB image to obtain a preprocessed RGB image;

[0007] S3: Convert the preprocessed RGB image into an HSV color space image;

[0008] S4: Segment the HSV color space image to form a plurality of sub-images, and output a sub-image list;

[0009] S5: based on preset upper and lower thresholds of the color to be identified, performing binary color gamut segmentation on the sub-images in the sub-image list, setting the color parts that meet the color gamut range of the color to be identified to white, and obtaining a plurality of binary MASKs;

[0010] S6: Calculate the ratio of the pixel value of the white part in the binary MASK of the current sub-image to the total pixel value of the binary MASK;

[0011] S7: If the ratio is greater than the second threshold, a valid score is calculated for the current sub-image, and the total score of the white parts in all the binary MASKs in the sub-image list is counted;

[0012] S8: Based on a preset third threshold, the total score is compared with the total score and an identification result is output. If the total score is greater than the third threshold, the output result is that the ventilator is invalid. If the total score is less than the third threshold, the output result is that the ventilator is valid.

[0013] By adopting the above scheme, the present application takes advantage of the characteristics of the substation respirator being either white or red. The original RGB image containing the substation respirator is first normalized and the image size is adjusted to a fixed value, and then the image is preprocessed. The preprocessed RGB image is converted into an HSV color space image, and then the HSV color space image is segmented to form a number of sub-images. The sub-images are then binarized and the color gamut is segmented to obtain a number of binary MASKs. The white parts in the binary MASKs are then scored, and then the total score of the white parts in all the binary MASKs in the sub-image list is counted. The total score is compared with the preset third threshold and the recognition result is output. The recognition result is that the respirator is invalid or the respirator is valid. There is no need for regular manual inspection of the respirator, thereby improving work efficiency.

[0014] Preferably, the image size of the fixed-size RGB image in step S1 is specifically: height h=250, width w=450.

[0015] By adopting the above technical solution, setting the size of the fixed-size RGB image to a height of h=250 and a width of w=450 is beneficial to subsequent image segmentation and binary color gamut segmentation.

[0016] Preferably, in step S3, the original RGB image is converted into an HSV color space image by the following formula:

[0017] Max = max(R, G, B);

[0018] Min = min(R, G, B);

[0019]

[0020] Wherein, f(x) represents the function of converting the original RGB image into the HSV color space image, R, G, B represent the values ​​of the red, green and blue components of the color pixel respectively, Max represents the maximum value, and Min represents the minimum value.

[0021] By adopting the above technical solution, the original RGB image can be converted into an HSV color space image more accurately through the algorithm.

[0022] Preferably, in step S2, the equalizeHist function of OpenCV is used to enhance the contrast of the fixed-size RGB image.

[0023] By adopting the above technical solution, the grayscale histogram equalization algorithm implemented by the equalizeHist function is to normalize each grayscale value of the histogram, calculate the cumulative distribution of each grayscale, and then obtain a mapped grayscale mapping table, and then correct each pixel in the original image according to the corresponding grayscale value.

[0024] Preferably, in step S2, the fixed-size RGB image is first converted into a grayscale image by OpenCV, and then the image is linearly superimposed and fused to achieve chromaticity enhancement.

[0025] By adopting the above technical solution, the fixed-size RGB image is first converted into a grayscale image, and then the image is linearly superimposed and fused to effectively achieve chromaticity enhancement.

[0026] Preferably, the linear superposition fusion of images is achieved by calling the interface function cv2.addWeighted in OpenCV.

[0027] By adopting the above technical solution, the cv2.addWeighted function is a function that linearly superimposes and fuses two pictures of the same size and type to achieve special effects of the picture.

[0028] Preferably, the image sizes of the plurality of sub-images in step S4 are all equal.

[0029] By adopting the above technical solution, the image sizes of several segmented HSV images are equal, so that the weight of the binary MASK score of each sub-image is the same, avoiding that the part with large error has a larger weight, and making the total score of the white part in all binary MASKs more accurate.

[0030] Preferably, in step S5, the sub-image is subjected to binary color gamut segmentation by using a threshold operation function cv2.inRange in OpenCV.

[0031] By adopting the above technical solution, cv2.inRange is a threshold operation function in the OpenCV computer vision open source library. The function of this function is to extract the desired color and set the area of ​​the color to white and the rest to black.

[0032] In the second aspect, the present application also proposes a substation respirator identification device based on color gamut extraction and segmentation, comprising:

[0033] An image acquisition module, wherein the image acquisition module is used to acquire an original RGB image;

[0034] A preprocessing module, wherein the preprocessing module is used to preprocess the original RGB image and obtain a preprocessed RGB image;

[0035] An image segmentation module, wherein the image segmentation module is used to segment the preprocessed RGB image into a plurality of sub-images;

[0036] A binary segmentation module, the binary segmentation module is used to perform binary color gamut segmentation on the plurality of sub-images and obtain a plurality of binary MASKs;

[0037] An output module, wherein the output module calculates the total score of the plurality of binary MASKs by the method described in the first aspect, compares the total score with a preset third threshold value, and outputs a recognition result; if the total score value is greater than the third threshold value, the output result is that the respirator is invalid; if the total score value is less than the third threshold value, the output result is that the respirator is valid.

[0038] By adopting the above scheme, the original RGB image is first acquired through the image acquisition module, and then the original RGB image is preprocessed by the preprocessing module to obtain a preprocessed RGB image, and then the preprocessed RGB image is segmented into a plurality of sub-images by the image segmentation module, and then the plurality of sub-images are binarized and segmented by the binarization segmentation module to obtain a plurality of binarized MASKs, and finally the total score of the plurality of binarized MASKs is calculated by the output module, and the total score is compared with the preset third threshold and the recognition result is output, and the recognition result is that the respirator is invalid or the respirator is valid, and there is no need for regular manual inspection of the respirator, thereby improving work efficiency.

[0039] In a third aspect, the present application further proposes a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the calculation method as described in the first aspect.

[0040] The present application proposes a method for identifying a substation respirator based on color gamut extraction and segmentation, normalizing, preprocessing, image segmentation and binary color gamut segmentation of the original RGB image containing the substation respirator, and then scoring the white part in the binary MASK, and finally comparing the total score with the preset third threshold and outputting the identification result, the identification result is invalid or valid, and there is no need for regular manual inspection of the respirator, thereby improving work efficiency. At the same time, the present application also proposes a substation respirator identification device based on color gamut extraction and segmentation, which uses the substation respirator identification method based on color gamut extraction and segmentation to identify the status of the substation respirator. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.

[0042] Figure 1 It is a flowchart of a method for identifying a substation respirator based on color gamut extraction and segmentation in one embodiment of the present application.

[0043] Figure 2 It is a schematic diagram of a specific embodiment of the substation respirator identification method based on color gamut extraction and segmentation of the present application.

[0044] Figure 3a It is an original RGB image containing a substation respirator in one embodiment of the present application.

[0045] Figure 3b It is an HSV color space image in one embodiment of the present application.

[0046] Figure 4 It is a schematic diagram of segmenting an HSV color space image in one embodiment of the present application.

[0047] Figure 5 It is a schematic diagram of a sub-image in a sub-image list in one embodiment of the present application.

[0048] Figure 6 It is a schematic diagram of performing binary color gamut segmentation on a segmented HSV color space image in one embodiment of the present application.

[0049] Figure 7 It is a schematic diagram of a binary MASK in a sub-image list in one embodiment of the present application.

[0050] Figure 8 It is a module diagram of a substation respirator identification device based on color gamut extraction and segmentation in one embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] The present invention will be described in detail below with reference to the accompanying drawings.

[0053] Figure 1 The invention shows the substation respirator identification method based on color gamut extraction and segmentation. Figure 2 A schematic diagram showing a specific embodiment of the method for identifying a substation respirator based on color gamut extraction and segmentation of the present application is shown, combined with reference Figure 1 and Figure 2 , the method comprises the following steps:

[0054] S1: Normalize the original RGB image containing the substation respirator and adjust the image size to a fixed value to obtain a fixed-size RGB image.

[0055] In a specific embodiment, OpenCV is used to normalize the original RGB image containing the substation respirator and adjust the image size to a fixed value, and the image size of the fixed-size RGB image is specifically: height h=250, width w=450.

[0056] S2: performing contrast enhancement and chroma enhancement on the fixed-size RGB image to obtain a preprocessed RGB image;

[0057] Contrast is the ratio of black to white in an image, that is, the gradient from black to white. The larger the ratio, the more gradients there are from black to white, and the richer the color performance. Contrast is critical to visual effects. Generally speaking, the greater the contrast, the clearer and more eye-catching the pattern, and the brighter the color; while a small contrast will make the entire picture gray.

[0058] In a specific embodiment, in step S2, the equalizeHist function of OpenCV is used to enhance the contrast of the fixed-size RGB image. The equalizeHist function of OpenCV uses a histogram equalization method to perform contrast enhancement. The purpose of histogram equalization is to redistribute the number of pixel points of each pixel value of the original image to 256 pixel values ​​of [0,255] so that the number of pixel points corresponding to each pixel value is approximately equal, that is, after redistribution, the number of pixel points corresponding to each pixel value of 0-255 is approximately (rows*cols / 256).

[0059] The parameter list of equalizeHist function used in OpenCV is as follows:

[0060] cv2.equalizeHist(src,dst);

[0061] src: image object matrix, must be single-channel uint8 type matrix data;

[0062] dst: output image matrix (same shape as src).

[0063] Chroma refers to the purity of color, also called saturation or color, and is one of the "three attributes of color". For example, scarlet red is redder than rose red, which means that scarlet red has a higher chroma. It is a descriptive color variable of the HSV color attribute model, Munsell color system, etc. In a broad sense, black, white, and gray are colors with "chroma = 0". In various color models, there are different quantification modes for chroma. Chroma is related to the intensity of light and the intensity distribution at different wavelengths. The highest chroma is generally achieved by strong light of a single wavelength (such as laser). When the wavelength distribution remains unchanged, the weaker the light intensity, the lower the chroma. In the three primary color light model, chroma can be quantified and σ is used to represent the difference between a certain color and a pure color:

[0064]

[0065] In a specific embodiment, in step S2, the fixed-size RGB image is first converted into a grayscale image by OpenCV, and then linearly superimposed and fused images are performed to achieve chromaticity enhancement. The linear superposition and fusion of images is performed by calling the interface function cv2.addWeighted in OpenCV.

[0066] S3: Convert the preprocessed RGB image into an HSV color space image;

[0067] In a specific embodiment, the preprocessed RGB image is converted into an HSV color space image such as Figure 3a and Figure 3b As shown. HSV color space is a way to represent color using hue, saturation, and value. Hue: represents color with 0° to 360°, which is the color name we talk about in daily life, such as red, blue, etc. Saturation: the purity of the color, the lower the saturation, the darker the color (0<=S<1); Value: the brightness of the color, the higher the value, the closer to white, and the lower the value, the closer to black (0<=V<1).

[0068] In this embodiment, the original RGB image is converted into an HSV color space image by the following formula:

[0069] Max = max(R, G, B);

[0070] Min = min(R, G, B);

[0071]

[0072] Wherein, f(x) represents the function of converting the original RGB image into the HSV color space image, R, G, B represent the values ​​of the red, green and blue components of the color pixel respectively, Max represents the maximum value, and Min represents the minimum value.

[0073] Regarding the calculation of the above conversion formula, there is the following calculation example table:

[0074]

[0075]

[0076] S4: Segment the HSV color space image to form a number of sub-images, and output a sub-image list.

[0077] Reference Figure 4 and Figure 5 In a specific embodiment, the HSV color space image is segmented by OpenCV, mainly by traversing the image and then segmenting it according to rows and columns. In this embodiment, the HSV color space image is segmented mainly by the following steps:

[0078] 1): Set the initial value of the split row and column: i=1, j=1;

[0079] 2): Segment the HSV color space image with the current number of rows i and columns j, and store the segmented sub-images into the current image list;

[0080] 3): If i is less than or equal to 5 and j is less than or equal to 5, then i=i+1, j=j+1, and return to step 2); otherwise, return to an empty list and proceed to step 4);

[0081] 4): Output the current image list.

[0082] In this embodiment, the HSV color space image is divided into 25 sub-images, and the image sizes of the 25 sub-images are equal.

[0083] S5: based on preset upper and lower thresholds of the color to be identified, performing binary color gamut segmentation on the sub-images in the sub-image list, setting the color parts that meet the color gamut range of the color to be identified to white, and obtaining a plurality of binary MASKs;

[0084] Reference Figure 6 and Figure 7 In a specific embodiment, the sub-image is binarized and segmented into a color space by using the threshold operation function cv2.inRange in OpenCV. cv2.inRange is a threshold operation function in the OpenCV computer vision open source library. The function of this function is to extract the desired color and set the area of ​​the color to white, and the rest to black.

[0085] S6: Calculate the ratio of the pixel value of the white part in the binary MASK of the current sub-image to the total pixel value of the binary MASK;

[0086] In a specific embodiment, the ratio of the pixel value of the white part in the binary MASK of the sub-image to the total pixel value of the binary MASK is calculated mainly based on the OpenCV visual library, and the area can be calculated according to the contour after the contour is extracted.

[0087] S7: If the ratio is greater than the second threshold, a valid score is calculated for the current sub-image, and the total score of the white parts in all the binary MASKs in the sub-image list is counted;

[0088] In a specific embodiment, if the ratio of the pixel value of the white part in the sub-image binary MASK to the total pixel value of the binary MASK is greater than 0.5, the effective score of the current sub-image color is 1; if the ratio of the pixel value of the white part in the sub-image binary MASK to the total pixel value of the binary MASK is less than or equal to 0.5, the effective score of the current sub-image color is 0.

[0089] S8: Based on a preset third threshold, the total score is compared with the total score and an identification result is output. If the total score is greater than the third threshold, the output result is that the ventilator is invalid. If the total score is less than the third threshold, the output result is that the ventilator is valid.

[0090] In a specific embodiment, the value of the preset third threshold is 5. If the total score is greater than 5, the current color of the respirator is determined to be red, and a result indicating that the respirator is invalid is output. If the total score is less than 5, the current color of the respirator is determined to be white, and a result indicating that the respirator is valid is output. This embodiment makes full use of the characteristic that the substation respirator is either white or red to identify the status of the respirator.

[0091] Further references Figure 8 As an implementation of the above method, the present application provides an embodiment of a substation respirator identification device based on color gamut extraction and segmentation. The system embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices, and the device includes:

[0092] Image acquisition module 201, image acquisition module 201 is used to acquire the original RGB image;

[0093] The preprocessing module 202 is used to preprocess the original RGB image and obtain a preprocessed RGB image;

[0094] An image segmentation module 203, the image segmentation module 203 is used to segment the pre-processed RGB image into a plurality of sub-images;

[0095] Binarization segmentation module 204, which is used to perform binary color gamut segmentation on a plurality of sub-images and obtain a plurality of binary MASKs;

[0096] Output module 205, the output module 205 calculates the total score of several binary MASKs by the method of the substation respirator identification method based on color gamut extraction and segmentation, and then compares it with the total score based on a preset third threshold and outputs the identification result. If the total score is greater than the third threshold, the output result is that the respirator is invalid; if the total score is less than the third threshold, the output result is that the respirator is valid.

[0097] When the substation respirator identification device based on color gamut extraction and segmentation is used, the image acquisition module 201 is first used to obtain the original RGB image, and then the preprocessing module 202 is used to preprocess the original RGB image and obtain the preprocessed RGB image, and then the image segmentation module 203 is used to segment the preprocessed RGB image into a number of sub-images, and then the binarization segmentation module 204 is used to perform binary color gamut segmentation on the sub-images and obtain a number of binary MASKs, and finally the output module 205 calculates the total score of the number of binary MASKs through the substation respirator identification method based on color gamut extraction and segmentation, and compares the total score based on the preset third threshold and outputs the identification result. If the total score is greater than the third threshold, the output result is that the respirator is invalid, and if the total score is less than the third threshold, the output result is that the respirator is valid. The use of this device can realize the state identification of the substation respirator, and there is no need for regular manual inspection of the respirator, thereby improving work efficiency.

[0098] According to the embodiments disclosed in this application, the above reference process Figure 1 The described processes may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a computer readable medium, the computer program including a method for executing Figure 1 When the computer program is executed by a central processing unit (CPU) and a graphics processing unit (GPU), the above functions defined in the method of the present application are performed.

[0099] It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, device or component, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution device, device or component. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution device, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0100] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0102] The modules involved in the embodiments described in the present application may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module, an analysis module, and an output module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0103] Although the principles of the present invention are described in detail above in conjunction with the preferred embodiments of the present invention, those skilled in the art should understand that the above embodiments are merely explanations of the exemplary implementations of the present invention, and are not intended to limit the scope of the present invention. The details in the embodiments do not constitute limitations on the scope of the present invention, and any obvious changes such as equivalent transformations, simple replacements, etc. based on the technical solution of the present invention, without departing from the spirit and scope of the present invention, fall within the protection scope of the present invention.

Claims

1. A substation respirator recognition method based on color gamut extraction and segmentation, Features: The following steps are involved: S1: normalize the original RGB image containing the substation respirator and adjust the image size to a fixed value to obtain a fixed-size RGB image; S2: performing contrast enhancement and chroma enhancement on the fixed-size RGB image to obtain a preprocessed RGB image; S3: Convert the preprocessed RGB image into an HSV color space image; The original RGB image is converted to an HSV color space image using the following formula: Max = max(R,G,B); Min = min(R, G, B); Where f(x) represents the function of converting the original RGB image into the HSV color space image, R, G, B represent the values ​​of the red, green and blue components of the color pixel, Max represents the maximum value, and Min represents the minimum value; S4: Segment the HSV color space image to form a plurality of sub-images, and output a sub-image list; S5: based on preset upper and lower thresholds of the color to be identified, performing binary color gamut segmentation on the sub-images in the sub-image list, setting the color parts that meet the color gamut range of the color to be identified to white, and obtaining a plurality of binary MASKs; The sub-image is segmented into a binary color space by using the threshold operation function cv2.inRange in OpenCV; S6: Calculate the ratio of the pixel value of the white part in the binary MASK of the current sub-image to the total pixel value of the binary MASK; S7: If the ratio is greater than the second threshold, a valid score is calculated for the current sub-image, and the total score of the white parts in all the binary MASKs in the sub-image list is counted; S8: Based on the preset third threshold, the total score is compared with the total score and the recognition result is output. If the total score is greater than the third threshold, the current color of the respirator is determined to be red, and the recognition result that the respirator is invalid is output. If the total score is less than the third threshold, the current color of the respirator is determined to be white, and the recognition result that the respirator is valid is output.

2. According to the method for identifying a substation respirator based on color gamut extraction and segmentation according to claim 1, It is characterized in that The image size of the fixed-size RGB image in step S1 is specifically: height h=250, width w=450.

3. According to the method for identifying a substation respirator based on color gamut extraction and segmentation according to claim 1, Features: In the step S2, the equalizeHist function of OpenCV is used to enhance the contrast of the fixed-size RGB image.

4. According to the method for identifying a substation respirator based on color gamut extraction and segmentation according to claim 1, Features: In step S2, the fixed-size RGB image is first converted into a grayscale image through OpenCV, and then the image is linearly superimposed and fused to achieve chromaticity enhancement.

5. According to the method for identifying a substation respirator based on color gamut extraction and segmentation according to claim 4, Features: The linear superposition and fusion of images are performed by calling the interface function cv2.addWeighted in OpenCV.

6. According to the method for identifying a substation respirator based on color gamut extraction and segmentation according to claim 1, Features: The image sizes of the plurality of sub-images in step S4 are all equal.

7. A substation respirator identification device based on color gamut extraction and segmentation, It is characterized in that include: An image acquisition module, wherein the image acquisition module is used to acquire an original RGB image; A preprocessing module, wherein the preprocessing module is used to preprocess the original RGB image and obtain a preprocessed RGB image; The original RGB image is converted to an HSV color space image using the following formula: Max = max(R,G,B); Min = min(R, G, B); Where f(x) represents the function of converting the original RGB image into the HSV color space image, R, G, B represent the values ​​of the red, green and blue components of the color pixel, Max represents the maximum value, and Min represents the minimum value; An image segmentation module, wherein the image segmentation module is used to segment the preprocessed RGB image into a plurality of sub-images; A binary segmentation module, the binary segmentation module is used to perform binary color gamut segmentation on the plurality of sub-images and obtain a plurality of binary MASKs; The sub-image is segmented into a binary color space by using the threshold operation function cv2.inRange in OpenCV; An output module, wherein the output module calculates the total score of the plurality of binary MASKs by the method described in any one of claims 1 to 6, compares the total score with a preset third threshold value, and outputs a recognition result; if the total score value is greater than the third threshold value, the output result is that the respirator is invalid; if the total score value is less than the third threshold value, the output result is that the respirator is valid.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.