A method and system for identifying a circular knob switch in a computer room scenario

Through the yolo v5 algorithm and Hough circular detection technology, combined with mask array and angle segmentation, the problem of the inconspicuous rotation switch profile in the computer room scene is solved, efficient identification in the environment of insufficient light is achieved, and inspection efficiency is improved. accuracy.

CN114241289BActive Publication Date: 2024-11-19SHANGHAI MOONPAC INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111553338.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-11-19
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In the computer room scene, the outline details of the rotary switch are not obvious, especially in the environment of insufficient lighting, it is difficult for the prior art to accurately identify circular knob switches of different switch sizes and models, resulting in low patrol efficiency and high hardware resource utilization.

Method used

The yolo v5 algorithm is used to combine mask array and Hough circular detection to extract the circular button switch part, perform angle segmentation and pixel value calculation, identify the gear position and angle of the circular knob switch, and realize real-time recognition using the PyTorch framework.

Benefits of technology

Accurate identification of circular rotary switches in environments with dark light and inconspicuous contours improves recognition efficiency and accuracy, reduces processing time, and is suitable for different switch sizes and models, taking into account real-time and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241289B_ABST
    Figure CN114241289B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for identifying a circular knob switch in a computer room scenario, wherein the method comprises: collecting status information of a cabinet or equipment in the computer room to obtain a first picture set; obtaining a picture IMG1 containing a circular button switch in the first picture set to identify the type of the circular button switch; performing circular detection based on the IMG1 to obtain the coordinates and radius of the center of the circular button switch; extracting the circular button switch part based on a mask array Mask to obtain a picture IMG2; performing angle segmentation on the IMG2 based on the type of the circular button switch to obtain a plurality of sector-shaped reference areas related to the gear position; calculating the pixel values ​​of the plurality of sector-shaped reference areas and outputting corresponding results. The present invention can detect and identify circular rotary switches of different switch sizes and models in an environment where the outline is not obvious.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and in particular relates to a method and system for identifying a circular knob switch in a computer room scenario. Background Art

[0002] At present, with the electrification and informatization of production and living scenes, facing the increasingly complex power and information networks, a control system composed of a large number of complex control devices is required. The computer room with centralized control system requires manpower to repeat some monotonous inspection and maintenance tasks on a daily basis. Large computer rooms have a variety of equipment, and there are many key points that need to be inspected with high repetition. The computer room itself has light noise pollution and potential electrical hazards. At the same time, the ambient lighting in the computer room is uneven and there are occlusions. At present, it is more popular to use the analysis of the details of the switch contour to identify the switch position. However, in the computer room usage scenario, in order to obtain a larger field of view and faster inspection efficiency, the inspection robot is generally far away from the equipment when collecting photos, which will cause the contour details of the rotary switch to be unclear. At the same time, at night or in the scene of the power room with closed lighting, there will be insufficient light, and the equipment is located on the backlight side of the cabinet. At this time, the knob switch is darker overall, and the contour information details of the knob are not obvious. The method that has a complex processing process, occupies a lot of robot hardware resources, and is time-consuming is unacceptable. Summary of the invention

[0003] In view of the defects in the above-mentioned prior art, the present invention provides a method and system for identifying circular knob switches in a computer room scenario, which can detect and identify circular rotary switches of different switch sizes and models in an environment with unclear outlines.

[0004] In a first aspect, the present invention provides a method for identifying a circular knob switch in a computer room scenario, comprising the following steps:

[0005] Step S101: collect status information of cabinets or equipment in a computer room to obtain a first picture set;

[0006] Step S103, obtaining the picture IMG1 containing the circular button switch in the first picture set, and identifying the type of the circular button switch;

[0007] Step S105, performing circle detection based on the IMG1 to obtain the center coordinates and radius of the circular button switch;

[0008] Step S107, extracting the circular button switch part based on the mask array Mask to obtain the image IMG2;

[0009] Step S109, based on the circular button switch type, performing angle segmentation on the IMG2 to obtain a plurality of sector-shaped reference areas related to the gear position;

[0010] Step S111, calculating the pixel values ​​of the multiple sector-shaped reference areas and outputting corresponding results.

[0011] Wherein, the step S103 specifically includes:

[0012] The first image set is parsed using the yolo v5 algorithm to obtain the image IMG1 containing a circular knob switch, and the type of the circular button switch is identified.

[0013] Wherein, before step S105, the method further includes:

[0014] The image IMG1 is converted into a grayscale image IMG3, subjected to adaptive debinarization, and noise is removed using a morphological gradient opening operation, and then proportionally scaled to a fixed value using a bilinear interpolation method to obtain an image IMG4.

[0015] Wherein, the step S105 specifically includes:

[0016] Perform Hough circle detection on the image IMG4 to obtain the center coordinates and radius of the circular button switch.

[0017] Wherein, before step S107, the method further includes:

[0018] Construct a mask array Mask, which has the same length and width as the image IMG4, and is assumed to have a set G, H, where G = {0, 1 ..., i}; H = {0, 1 ..., j};

[0019] The Cartesian product is then expressed as:

[0020] G×H={(n,m)|n∈G∧m∈H};

[0021] The resolution of the image IMG4 is w*h, and the center coordinates of the circular button switch are (C x , C y ), the circle radius is r; assuming the coordinate arrays A and B:

[0022] A={0,1…,w-1}; B={0,1…,h-1}

[0023] Then the pixel coordinate array D is:

[0024]

[0025] Then the distance between each pixel point in IMG4 and the center of the circle (C x , C y ) is represented by the array DIS consisting of the Euclidean distances:

[0026]

[0027] Where D (i,j,0) represents the value x at the i-th column and j-th row in D, D (i,j,1) Represents the value y at the i-th column and j-th row in D, then the mask array Mask is expressed as:

[0028]

[0029] The step S107 specifically includes: using the mask array Mask to multiply IMG3 point by point to obtain an image where the pixel values ​​of the circular area where the circular button switch is located remain unchanged and the other pixel values ​​are all 0, and the center of the circle (C x , C y) The part with pixel value 0 is cut off for the center index to obtain the image IMG2 with length and width 2r.

[0030] Wherein, the step S109 includes:

[0031] Based on the detected circular push button switch type, assign a preset list of gear center angles in ascending order [θ1, θ2, ..., θ n ];

[0032] The area between two adjacent center angles is divided according to the preset gear center angle to obtain a plurality of sector-shaped reference areas related to the gear.

[0033] Wherein, the dividing of the area between two adjacent center angles according to the preset gear center angle includes:

[0034] Assume that the two adjacent center angles of the fan-shaped reference area are (θ i ,θ i+1 ), where θ i and θ i+1 It is within the monotonically increasing period of the tangent function, that is, π / 2 or 3π / 2 is not within the interval (θ i ,θ i+1 ), construct a three-dimensional coordinate array D1 with the same length and width as IMG2; the slope of the two edge straight lines of the fan in the image coordinate system is tan(-θ i ) and -tan(-θ i+1 ), the point that must be passed is the center of the circle (r,r), and the fan is located between the two straight lines, then these two straight lines can be expressed as:

[0035] y1=-tanθ i *(x1-r)+r and y2=-tanθ i+1 *(x2-r)+r

[0036] When (θ i ,θ i+1) is in the interval (π / 2,3π / 2), xr<0; the mask array Mask1 of the area where the sector is located can be expressed as:

[0037]

[0038] When (θ i ,θ i+1 ) is in the interval (-π / 2,π / 2), xr>0; the mask array Mask1 of the area where the sector is located can be expressed as:

[0039]

[0040] in:

[0041]

[0042] The mask array Mask1 is used to perform point-to-point multiplication with IMG2 to obtain the sector-shaped reference area.

[0043] The step of calculating the pixel values ​​of the plurality of sector-shaped reference areas specifically includes:

[0044] When calculating the pixel value of the sector-shaped reference area, when π / 2 or 3π / 2 is located within two adjacent central angles of a sector-shaped reference area, two new thresholds are inserted on both sides of π / 2 or 3π / 2 respectively:

[0045] π / 2±tan -1 (1 / r) or 3π / 2±tan -1 (1 / r);

[0046] The sector-shaped reference area where π / 2 or 3π / 2 is located is divided into a plurality of sub-areas.

[0047] The pixel values ​​of all sub-areas divided from the sector-shaped reference area where π / 2 or 3π / 2 is located are superimposed, and the semi-axis pixel value located in the direction of π / 2 or 3π / 2 is added as the value of the pixel in the current sector-shaped reference area;

[0048] When π / 2 or 3π / 2 is not within a certain sector threshold angle, the sector reference area is the sum of the pixel values ​​of all sub-areas.

[0049] In a second aspect, a system for identifying a circular knob switch in a computer room scenario is also provided, including:

[0050] A data collection module, which is used to collect status information of cabinets or equipment in the computer room and obtain a first picture set;

[0051] An image recognition module is used to obtain an image IMG1 containing a circular button switch in a first image set, and identify the type of the circular button switch;

[0052] An image detection module is used to perform circle detection based on IMG1 and obtain the center coordinates and radius of the circular button switch;

[0053] An image extraction module is used to extract the circular button switch part based on the mask array Mask to obtain an image IMG2;

[0054] An image segmentation module, which is used to perform angle segmentation on IMG2 based on the circular button switch type to obtain multiple sector-shaped reference areas related to the gear position;

[0055] The result processing module is used to calculate the pixel values ​​of multiple sector-shaped reference areas and output corresponding results.

[0056] Compared with the prior art, the present invention utilizes the characteristics of the key part of the knob switch in the image, adopts a statistical method to identify the knob gear position, and uses the yolo v5 model under the pytorch framework to output the knob switch position. While ensuring accurate recognition and less missed detection and false detection, it takes real-time into account, so that the time consumed in the process of processing the image will not affect the inspection efficiency of the robot. The present invention has the advantages of fast response, reliable principle, high accuracy, good applicability to different sizes and models of circular knobs, and can detect and identify circular rotary switches in an environment with dim light and unclear outlines. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0058] Figure 1 is a flow chart showing a method for identifying a circular knob switch in a computer room scenario according to an embodiment of the present invention;

[0059] Figure 2 is a schematic diagram showing conversion into a grayscale image according to an embodiment of the present invention;

[0060] Figure 3 is a schematic diagram showing a picture IMG4 according to an embodiment of the present invention;

[0061] Figure 4 is a schematic diagram showing a Hough circle detection result according to an embodiment of the present invention;

[0062] Figure 5 is a schematic diagram showing angle segmentation according to an embodiment of the present invention;

[0063] Figure 6is a schematic diagram showing an applicable circular knob switch according to an embodiment of the present invention; and

[0064] Figure 7 It is a schematic diagram showing a system for identifying a circular knob switch in a computer room scenario according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] 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.

[0066] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.

[0067] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.

[0068] The optional embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0069] Embodiment 1

[0070] General computer vision problems can be divided into two parts to solve: one is the positioning problem, and the other is the content recognition problem. Based on the distribution law of the overall shape contour and feature area of ​​the circular knob switch, the present invention can reliably and quickly detect the circular knob switch and identify the current switch position and angle through statistical methods. Although there are many styles of circular rotary switches from different manufacturers, they can still be divided into the type with a wrench extension and the type without a wrench extension. The obvious and easily distinguishable marking spots that basically exist on the circular knob part indicate the current position of the switch. Based on this, an embodiment of the present invention provides a method for identifying a circular knob switch in a computer room scenario, including

[0071] Step S101: collect status information of cabinets or equipment in a computer room to obtain a first picture set;

[0072] Step S103, obtaining the picture IMG1 containing the circular button switch in the first picture set, and identifying the type of the circular button switch;

[0073] Step S105: perform circle detection based on IMG1 to obtain the center coordinates and radius of the circular button switch;

[0074] Step S107, extracting the circular button switch part based on the mask array Mask to obtain the image IMG2;

[0075] Step S109, based on the circular button switch type, angularly segment IMG2 to obtain a plurality of sector-shaped reference areas related to the gear position;

[0076] Step S111, calculating pixel values ​​of multiple sector-shaped reference areas and outputting corresponding results.

[0077] Embodiment 2

[0078] The present invention provides a method for identifying a circular knob switch in a computer room scenario, comprising the following steps:

[0079] Step S101, collecting status information of cabinets or equipment in a computer room to obtain a first picture set; specifically, the step may include:

[0080] The intelligent inspection robot obtains several images IMG0 of cabinets or equipment during the inspection of the power room, and the images IMG0 constitute a first image set;

[0081] Step S103, obtaining the picture IMG1 containing the circular button switch in the first picture set, and identifying the type of the circular button switch; specifically, the method may include:

[0082] Use the trained yolo v5 algorithm based on the PyTorch framework to process the image IMG0 in the first image set, output the image IMG0 containing the target frame of the circular knob switch and the switch type, and slice and output the image IMG1 containing only the circular rotary switch from the output image IMG0;

[0083] After identifying the round button switch type, convert the image IMG1 into a grayscale image IMG3 (such as Figure 2 As shown), after adaptive debinarization, the morphological gradient opening operation is used to remove noise, and then the bilinear interpolation method is used to scale the small side to 360 pixels in proportion to obtain the image IMG4; preferably, the threshold function of the opencv library is used with the THRESH_OTSU and THRESH_BINARY_INV function options to achieve adaptive debinarization, and the morphological gradient opening operation is used to remove small noise to obtain the image IMG4 (as shown Figure 3 shown);

[0084] Step S105, performing circle detection based on IMG1 to obtain the center coordinates and radius of the circular button switch; specifically, the method may include:

[0085] Perform Hough circle detection on image IMG4 to obtain the center coordinates and radius of the circular button switch (the detection result is as follows Figure 4 As shown); in order to eliminate the influence of the circular boundary, in this embodiment, the radius is multiplied by a multiple less than 1. Preferably, the obtained radius can be multiplied by 0.9 to 0.95, and the value is rounded down to obtain the radius r of the circular button switch;

[0086] Step S107, extracting the circular button switch part based on the mask array Mask slice to obtain the image IMG2; specifically, the method may include: using the mask array Mask and IMG3 to perform point-to-point multiplication to obtain an image where the pixel values ​​of the circular area where the circular button switch is located remain unchanged and the other pixel values ​​are all 0, and taking the center (C x , C y) Cut off the part with pixel value 0 for the center index to obtain the image IMG2 with length and width 2r;

[0087] Step S109, based on the circular button switch type, angularly segment IMG2 to obtain a plurality of sector-shaped reference areas related to the gear position;

[0088] Step S111, calculating the pixel values ​​of a plurality of sector-shaped reference areas, obtaining the sector-shaped reference area where the maximum pixel value is located, and outputting the gear information corresponding to the sector-shaped reference area.

[0089] Embodiment 3

[0090] Based on the above embodiment, this embodiment may further include the following contents:

[0091] This implementation may also include the following before extracting the circular button switch part based on the mask array Mask:

[0092] Use the numpy library array operation tool to construct a mask array Mask, which has the same length and width as the image IMG4. Assume that it has a set G, H, where G = {0, 1..., i}; H = {0, 1..., j};

[0093] The Cartesian product is then expressed as:

[0094] G×H={(n,m)|n∈G∧m∈H};

[0095] First, in the program design of this embodiment, for the convenience of processing, a form in which several elements of the same type are organized in an ordered form is called an array. In computer image processing, images are read, stored and processed by the computer in the form of an array.

[0096] Similarly, in image processing, the above Cartesian product constructs a coordinate array;

[0097] If the resolution of image IMG4 is w*h, the coordinates of the center of the circular button switch are (C x , C y ), the circle radius is r; assuming the coordinate arrays A and B:

[0098] A={0,1…,w-1}; B={0,1…,h-1}

[0099] Then the pixel coordinate array D is:

[0100]

[0101] Then the distance between each pixel point in IMG4 and the center of the circle (C x , C y ) is represented by the array DIS consisting of the Euclidean distances:

[0102]

[0103] Where D (i,j,0) represents the value x at the i-th column and j-th row in D, D (i,j,1) Represents the value y at the i-th column and j-th row in D, then the mask array Mask is expressed as:

[0104]

[0105] At this time, the value of the point in the Mask corresponding to the inside of the circle is 1, otherwise, if the point is at the edge of the circle or outside the circle, the value is 0.

[0106] In this embodiment, when extracting the circular button switch part based on the mask array Mask, the concentric circles smaller than 0.2 to 0.5 times the radius can also be masked at the same time, so as to obtain the image IMG2 (such as Figure 5 ).

[0107] Exemplarily, the rotation switch center angle segmentation threshold is π / 4-5π / 12-7π / 12-3π / 4; three sector-shaped reference areas are generated (such as Figure 5 By statistically analyzing the pixel values ​​of the three regions, it can be concluded that the pixel value located in the second sector-shaped reference region 5π / 12-7π / 12 is the largest, so the circular knob gear angle is the median value π / 2 of the center angle of the second sector-shaped reference region, and the corresponding pre-configured gear is the second gear.

[0108] Embodiment 4:

[0109] Based on the above embodiment, this embodiment may further include the following contents:

[0110] In this embodiment, when the image IMG2 is segmented by angle to obtain multiple sector-shaped reference areas, the following may be specifically included:

[0111] Based on the detected circular push button switch type, assign a preset list of gear center angles in ascending order [θ1, θ2, ..., θ n ];

[0112] The area between two adjacent center angles is divided according to the preset gear center angle to obtain a plurality of sector-shaped reference areas related to the gear.

[0113] In actual application scenarios, when dividing the area between two adjacent center angles according to the preset gear center angle, it may specifically include:

[0114] Assume that the two adjacent center angles of the fan-shaped reference area are (θ i ,θ i+1 ), where θ i and θ i+1 It is within the monotonically increasing period of the tangent function, that is, π / 2 or 3π / 2 is not within the interval (θ i ,θ i+1 ), construct a three-dimensional coordinate array D1 with the same length and width as IMG2; because the origin of the coordinate system in the image is generally stipulated to be located at the first pixel in the upper left corner of the image, the direction of the horizontal axis is from left to right, and the direction of the vertical axis is from top to bottom, which is opposite to the vertical axis direction of the common coordinate system; so in the eyes of ordinary observers, the positive direction of the horizontal axis is 0 degrees, and the counterclockwise direction is the positive direction of rotation. After rotation α, the rotation angle in the image coordinate system is -α; the angle descriptions that appear below, unless otherwise stated, refer to the angles in the normal Cartesian coordinate system. The slopes of the two edge lines of the fan in the image coordinate system are tan(-θ i ) and -tan(-θ i+1 ), the point that must be passed is the center of the circle (r,r), and the fan is located between the two straight lines, then these two straight lines can be expressed as:

[0115] y1=-tanθ i *(x1-r)+r and y2=-tanθ i+1 *(x2-r)+r

[0116] When (θ i ,θ i+1 ) is in the interval (π / 2,3π / 2), xr<0; the mask array Mask1 of the area where the sector is located can be expressed as:

[0117]

[0118] When (θ i,θ i+1 ) is in the interval (-π / 2,π / 2), xr>0; the mask array Mask1 of the area where the sector is located can be expressed as:

[0119]

[0120] in:

[0121]

[0122] Use the mask array Mask1 to multiply IMG2 point by point to obtain the fan-shaped reference area.

[0123] Embodiment 5

[0124] Based on the above embodiment, this embodiment may further include the following contents:

[0125] In this embodiment, when calculating the pixel values ​​of multiple sector-shaped reference areas, it may specifically include:

[0126] When calculating the pixel value of the sector reference area, since the tangent value of π / 2 or 3π / 2 is not desirable, when π / 2 or 3π / 2 is located within two adjacent central angles of a sector reference area, two new thresholds are inserted on both sides of π / 2 or 3π / 2:

[0127] π / 2±tan -1 (1 / r) or 3π / 2±tan -1 (1 / r);

[0128] Divide the sector-shaped reference region where π / 2 or 3π / 2 is located into a plurality of sub-regions and the π / 2 or 3π / 2 axis itself;

[0129] The pixel values ​​of all sub-areas divided from the sector-shaped reference area where π / 2 or 3π / 2 is located are superimposed, and the semi-axis pixel value located in the direction of π / 2 or 3π / 2 is added as the value of the pixel in the current sector-shaped reference area;

[0130] For example, assume that the interval between two adjacent central angles of a circle is (π / 4, 3π / 4), and π / 2 is in this interval. The radius of the circle is detected to be r, and π / 2±arctan(1 / r) is used as the two new threshold segmentation intervals (skipping the π / 2 axis and swinging 1 pixel forward and backward on the circle axis), that is, divided into three parts: (π / 4, π / 2-arctan(1 / r)), (π / 2+arctan(1 / r), 3π / 4), and the π / 2 axis. The pixel values ​​are then calculated separately and added up to get the total.

[0131] When π / 2 or 3π / 2 is not within a certain sector threshold angle, the sector reference area is the sum of the pixel values ​​of all sub-areas.

[0132] Since the gear mark spot will make the pixel value of the sector reference area where it is located higher, filtering the maximum value of the pixel value of the sector reference area will obtain the sector where the mark spot is located, and the reverse index can obtain the current gear and angle of the knob switch.

[0133] The embodiment of the present invention is applicable to a circular knob switch: the switch has a circular portion; the indicator spot on the switch is located inside the circular portion; the image captured by the camera is clear, the photosensitive surface is parallel to the plane where the rotary switch is located, and the circular portion of the circular knob switch in the captured image has no obvious elliptical distortion (such as Figure 6 shown).

[0134] Embodiment 6

[0135] like Figure 7 As shown, this embodiment also provides a system for identifying a circular knob switch in a computer room scenario, including:

[0136] A data collection module, which is used to collect status information of cabinets or equipment in the computer room and obtain a first picture set;

[0137] An image recognition module is used to obtain an image IMG1 containing a circular button switch in a first image set, and identify the type of the circular button switch;

[0138] An image detection module is used to perform circle detection based on IMG1 and obtain the center coordinates and radius of the circular button switch;

[0139] An image extraction module is used to extract the circular button switch part based on the mask array Mask to obtain an image IMG2;

[0140] An image segmentation module, which is used to perform angle segmentation on IMG2 based on the circular button switch type to obtain multiple sector-shaped reference areas related to the gear position;

[0141] The result processing module is used to calculate the pixel values ​​of multiple sector-shaped reference areas and output corresponding results.

[0142] Embodiment 7

[0143] An embodiment of the present disclosure provides a non-volatile computer storage medium, which stores computer executable instructions. The computer executable instructions can execute the method steps of the above embodiment.

[0144] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage 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 disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0145] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0146] Computer program code for performing the operations of the present disclosure 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 (AN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] 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 disclosure. 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 implementations as replacements, 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.

[0148] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0149] The above introduces the preferred embodiments of the present invention, which is intended to make the spirit of the present invention clearer and easier to understand, but is not intended to limit the present invention. All modifications, substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection outlined by the claims attached to the present invention.

Claims

1. A method for identifying a circular knob switch in a computer room scenario. It is characterized in that The following steps are involved: Step S101: collect status information of cabinets or equipment in a computer room to obtain a first picture set; Step S103, obtaining the picture IMG1 containing the circular button switch in the first picture set, and identifying the type of the circular button switch; Step S105, performing circle detection based on the IMG1 to obtain the center coordinates and radius of the circular button switch; Step S107, extracting the circular button switch part based on the mask array Mask to obtain the image IMG2; Step S109, based on the circular button switch type, performing angle segmentation on the IMG2 to obtain a plurality of sector-shaped reference areas related to the gear position; Step S111, calculating the pixel values ​​of the plurality of sector-shaped reference areas and outputting corresponding results; Before step S105, the method further includes: The image IMG1 is converted into a grayscale image IMG3, subjected to adaptive debinarization, noise is removed using a morphological gradient opening operation, and then proportionally scaled to a fixed value using a bilinear interpolation method to obtain an image IMG4; Before step S107, the method further includes: Construct a mask array Mask, which has the same length and width as the image IMG4, and is assumed to have a set G, H, where G = {0, 1 ..., i}; H = {0, 1 ..., j}; The Cartesian product is then expressed as: G×H={(n,m)|n∈G∧m∈H}; The resolution of the image IMG4 is w*h, and the center coordinates of the circular button switch are (C x , C y ), the circle radius is r; assuming the coordinate arrays A and B: A={0,1…,w-1}; B={0,1…,h-1} Then the pixel coordinate array D is: Then the distance between each pixel point in IMG4 and the center of the circle (C x , C y ) is represented by the array DIS consisting of the Euclidean distances: Where D (i,j,0) represents the value x at the i-th column and j-th row in D, D (i,j,1) Represents the value y at the i-th column and j-th row in D, then the mask array Mask is expressed as:

2. The method according to claim 1, It is characterized in that The step S103 specifically includes: The first image set is parsed using the yolo v5 algorithm to obtain the image IMG1 containing a circular knob switch, and the type of the circular button switch is identified.

3. The method according to claim 1, It is characterized in that The step S105 specifically includes: Perform Hough circle detection on the image IMG4 to obtain the center coordinates and radius of the circular button switch.

4. The method according to claim 1, It is characterized in that The step S107 specifically includes: using the mask array Mask to multiply IMG3 point by point to obtain an image in which the pixel values ​​of the circular area where the circular button switch is located remain unchanged and the remaining pixel values ​​are all 0, and cutting off the part with the pixel value of 0 with the center of the circle (Cx, Cy) as the center index to obtain an image IMG2 with a length and width of 2r.

5. The method according to claim 1, It is characterized in that The step S109 includes: Based on the detected circular push button switch type, assign a preset gear position center angle in ascending order [θ 1 ,θ 2 ,...,θ n ]; The area between two adjacent center angles is divided according to the preset gear center angle to obtain a plurality of sector-shaped reference areas related to the gear.

6. The method according to claim 5, It is characterized in that The process of dividing the area between two adjacent center angles according to the preset gear center angle includes: Assume that the two adjacent center angles of the fan-shaped reference area are (θ i ,θ i+1 ), where θ i and θ i+1 It is within the monotonically increasing period of the tangent function, that is, π / 2 or 3π / 2 is not within the interval (θ i ,θ i+1 ) to construct a three-dimensional coordinate array D with the same length and width as IMG2 1 ; The slope of the two edge lines of the fan in the image coordinate system is tan(-θ i ) and -tan(-θ i+1 ), the point that must be passed is the center of the circle (r,r), and the fan is located between the two straight lines, then these two straight lines can be expressed as: y 1 = -tanθ i *(x 1 - r) + r and y 2 = -tanθ i+1 *(x 2 - r) + r When (θ i ,θ i+1 ) is in the interval (π / 2,3π / 2), xr<0; the mask array Mask1 of the area where the sector is located can be expressed as: When (θ i ,θ i+1 ) is in the interval (-π / 2,π / 2), xr>0; the mask array Mask1 of the area where the sector is located can be expressed as: in: The mask array Mask1 is used to perform point-to-point multiplication with IMG2 to obtain the sector-shaped reference area.

7. The method according to claim 6, It is characterized in that The calculating pixel values ​​of the plurality of sector-shaped reference areas specifically comprises: When calculating the pixel value of the sector-shaped reference area, when π / 2 or 3π / 2 is located within two adjacent central angles of a sector-shaped reference area, two new thresholds are inserted on both sides of π / 2 or 3π / 2 respectively: π / 2±tan -1 (1 / r) or 3π / 2±tan -1 (1 / r); Divide the sector-shaped reference area where π / 2 or 3π / 2 is located into multiple sub-areas; The pixel values ​​of all sub-areas divided from the sector-shaped reference area where π / 2 or 3π / 2 is located are superimposed, and the semi-axis pixel value located in the direction of π / 2 or 3π / 2 is added as the value of the pixel in the current sector-shaped reference area; When π / 2 or 3π / 2 is not within a certain sector threshold angle, the sector reference area is the sum of the pixel values ​​of all sub-areas.

8. A system for realizing the circular knob switch identification method according to any one of claims 1 to 7, It is characterized in that include: A data collection module, which is used to collect status information of cabinets or equipment in the computer room and obtain a first picture set; An image recognition module is used to obtain an image IMG1 containing a circular button switch in a first image set, and identify the type of the circular button switch; An image detection module is used to perform circle detection based on IMG1 and obtain the center coordinates and radius of the circular button switch; An image extraction module is used to extract the circular button switch part based on the mask array Mask to obtain an image IMG2; An image segmentation module, which is used to perform angle segmentation on IMG2 based on the circular button switch type to obtain multiple sector-shaped reference areas related to the gear position; The result processing module is used to calculate the pixel values ​​of multiple sector-shaped reference areas and output corresponding results.