Knob switch position identification method, device, electronic device and storage medium
By identifying the knob switch area at the computer room inspection site and calculating the included angle, intelligent monitoring of the gear status of the knob switch is achieved, solving the problem of real-time identification and monitoring in the existing technology, and improving the convenience of remote maintenance.
Patent Information
- Application Number
- CN202111160540.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-09-30
AI Technical Summary
The prior art cannot detect and identify the gear status of the knob switch in the computer room in real time through monitoring means, resulting in inconvenient remote maintenance and affecting the progress of the work of the unattended computer room.
By obtaining the preset position map of the computer room inspection site, identifying the overall area and indicator end area of the knob switch, and calculating the angle between the line to be measured and the preset reference line to determine the gear position of the knob switch.
It realizes intelligent monitoring of the gear status of the knob switch, solves the problems of real-time identification and monitoring, and improves the convenience of remote maintenance.
Smart Images

Figure CN113887415B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic inspection of rail transit machine room equipment and video analysis technology of low-voltage power distribution equipment in power systems, and in particular to a method, device, electronic equipment and storage medium for identifying the gear position of a knob switch. Background Art
[0002] The rotary switch is a common switch in the computer room that uses a rotating handle to control the on and off of the main contacts. The rotary switch is a very important electrical appliance in the low-voltage power distribution system of the computer room. It is a key device that can complete the contact and disconnection of circuits, power conversion, and adjustment selection. The inspection of the rotary switch is the focus of the inspection of the unmanned computer room. The rotary switch is a non-intelligent device. Under the existing technology, it is impossible to detect and identify the gear status of the rotary switch in the computer room in real time through monitoring means, which brings great inconvenience to remote maintenance and is not conducive to the promotion of unmanned work in remote computer rooms.
[0003] By setting camera inspection preset positions, planned inspections can be carried out on designated equipment in the computer room, and preset inspection videos and preset position images can be shot, which makes image processing and video analysis possible and convenient. Summary of the invention
[0004] The present invention provides a method, device, electronic device and storage medium for identifying the gear state of a knob switch, so as to solve the problem that the gear state of a knob switch cannot be automatically and intelligently monitored.
[0005] In a first aspect, the present invention provides a method for identifying a gear state of a knob switch, the method comprising:
[0006] Obtain the preset location map of the equipment room inspection site;
[0007] Acquire the entire area of the knob switch and the indicating end area of the knob switch from the preset position map;
[0008] Obtaining a line connecting the center of the entire area of the knob switch and the center of the indicating end area of the knob switch as a line to be tested;
[0009] The angle between the line to be measured and a preset reference line is obtained, and the gear position of the knob switch is determined according to the angle.
[0010] In a second aspect, the present invention provides an identification device, which includes a unit for executing the knob switch gear state identification method described in any embodiment of the first aspect.
[0011] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0012] Memory, used to store computer programs;
[0013] The processor is used to implement the steps of the knob switch gear state identification method described in any embodiment of the first aspect when executing the program stored in the memory.
[0014] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for identifying the gear state of the knob switch as described in any embodiment of the first aspect are implemented.
[0015] The above technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:
[0016] The method provided by the embodiment of the present invention obtains the overall area of the knob switch and the indicating end area of the knob switch; obtains the line connecting the center of the overall area of the knob switch and the center of the indicating end area of the knob switch as the line to be tested; obtains the angle between the line to be tested and a preset reference line, and determines the gear position of the knob switch according to the angle, thereby achieving intelligent monitoring of the gear position state of the knob switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A schematic diagram of a flow chart of a method for identifying a knob switch position provided by an embodiment of the present invention;
[0020] Figure 2 A physical diagram of a knob switch provided in an embodiment of the present invention;
[0021] Figure 3 Another physical diagram of the knob switch provided by the embodiment of the present invention;
[0022] Figure 4 A schematic diagram of a sub-process of a method for identifying a knob switch position provided by an embodiment of the present invention;
[0023] Figure 5 A schematic flow chart of a method for identifying a knob switch position provided in Embodiment 2 of the present invention;
[0024] Figure 6 A structural block diagram of a knob switch position identification device provided by an embodiment of the present invention;
[0025] Figure 7 A structural block diagram of another device for identifying the gear position of a knob switch provided by an embodiment of the present invention;
[0026] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of 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.
[0028] Example 1
[0029] Figure 1 The present invention provides a method for identifying the position of a rotary switch. Figure 1 The method for identifying the position of the knob switch includes the following steps S101-S104.
[0030] S101, obtaining a preset position map of the equipment room inspection site.
[0031] In a specific implementation, the camera inspection preset position is set according to the best shooting angle; during inspection, the camera locks the inspection device according to the preset position information set for the inspection task to shoot, and obtains the corresponding preset position map.
[0032] S102: Acquire the entire area of the knob switch and the indicating end area of the knob switch from the preset position map.
[0033] In a specific implementation, the trained instance segmentation algorithm model is called to extract the overall area of the knob switch and the indicating end area of the knob switch from the preset bitmap to obtain the overall area of the knob switch and the indicating end area of the knob switch.
[0034] In a specific implementation, the indication end area of the knob switch is the handle area of the knob switch, including the obvious indication feature identification part or the protruding part of the handle of the knob switch. The overall area of the knob switch includes the dial part of the knob switch and the handle part of the knob switch.
[0035] For example, see Figure 2 and Figure 3 , Figure 2 This is a physical diagram of a knob switch provided by an embodiment of the present invention. Specifically, Figure 2 A is the overall area of the knob switch, and B is the obvious indicator feature of the knob switch. Figure 3 Another physical diagram of the knob switch provided in the embodiment of the present invention. Specifically, Figure 3 B-1 in it is an obvious indication feature mark, and B-2 is a handle protrusion. In one embodiment, the recognition order can be preferentially specified to determine the indication end area of the knob switch. Specifically, if the trained instance segmentation algorithm recognizes a partial handle area containing the obvious indication feature mark of B-1, the partial handle area containing the obvious indication feature mark of B-1 is used as the indication end area; if the trained instance segmentation algorithm cannot recognize the partial handle area containing the obvious indication feature mark of B-1, the handle protrusion containing B-2 is recognized, and if the trained instance segmentation algorithm recognizes the handle protrusion containing B-2, the handle protrusion containing B-2 is used as the indication end area; if the trained instance segmentation algorithm cannot recognize the partial handle area containing the obvious indication feature mark of B-1, the handle protrusion containing B-2 is recognized, and if the trained instance segmentation algorithm cannot recognize the handle protrusion containing B-2, the recognition failure result is output.
[0036] The above step S102 includes: based on the instance segmentation algorithm in the deep learning algorithm, identifying the preset bitmap to obtain the overall area of the knob switch and the indication end area of the knob switch.
[0037] In the specific implementation, when the trained instance segmentation algorithm model is called, the preset bitmap will be recognized. The overall area of the knob switch in the image will be recognized first, and then the indication end area will be identified from the overall area of the knob switch through identification, thereby obtaining the overall area of the knob switch in a geometric shape and the indication end area of the knob switch.
[0038] S103, obtaining a line connecting the center of the entire area of the knob switch and the center of the indicating end area of the knob switch as a line to be tested.
[0039] In a specific implementation, the overall area of the knob switch is the dial area of the knob switch or the handle area of the knob switch, and the indication end area of the knob switch is a part of the knob switch handle that is easy to identify, including a mark with obvious indication features or a protruding part of the handle. The above two areas are processed to obtain the center or center of gravity of the above two areas, and the two centers or center of gravity points are connected, and the obtained connecting line is the line to be measured. Specifically, the area on the handle with obvious indication features and the protruding part of the handle may be in opposite directions. Here, one of the areas can be selected as the indication end area, or a judgment can be made based on the two areas. This patent does not limit this.
[0040] In one embodiment, see Figure 4 , Figure 4 A schematic diagram of a sub-flow of a method for identifying a knob switch position provided by an embodiment of the present invention. The above step S103 includes steps S401-S402.
[0041] S401 : Acquire a first geometric center of an outer contour of the entire region and a second geometric center of an outer contour of the indication end region.
[0042] In a specific implementation, the first geometric center is the center or center of gravity of the entire area, or the outline of the entire area, or the circumscribed polygon of the entire area. The second geometric center is the center or center of gravity of the area with obvious indicator features on the handle or the geometric figure of the protruding part of the handle.
[0043] S402, connecting the first geometric center and the second geometric center through a line segment to obtain the line to be measured.
[0044] In a specific implementation, the center of the geometric figure of the overall area of the knob switch and the center of the geometric figure of the indicating end area are connected, and the obtained connecting line is the line to be tested.
[0045] S104, obtaining an angle between the line to be measured and a preset reference line, and determining a gear position of the knob switch according to the angle.
[0046] In a specific implementation, the line to be measured is a line connecting the center of the entire area of the preset knob switch and the center of the indicating end area of the knob switch. The center of the entire area of the knob switch is used as the origin to determine the starting angle direction (0 degree direction). A ray is made from the origin and the starting angle direction (0 degree direction), and the ray is the reference line. Specifically, through the formula The angle between the line to be measured and the preset starting angle direction is obtained, where θ is the angle between the line to be measured and the preset starting angle direction, O(x o ,y o ) is the center coordinate of the overall area, A(xa ,y a ) is the center coordinate of the indicating end area. The value of θ can be combined with the preset angle range to obtain the gear position of the knob switch.
[0047] In one embodiment, the center of the overall area of the knob switch is taken as the origin, the horizontal rightward is taken as the starting angle direction (0 degree direction), and the clockwise rotation is taken as the positive direction, the reference line is determined, and a unified and regular angle coordinate system is established. The angle between the line to be measured and the preset starting angle direction is then used to describe the handle direction of the knob switch.
[0048] In one embodiment, the above step S104 includes: determining the gear corresponding to the angle according to a preset angle-gear correspondence relationship.
[0049] In a specific implementation, the angle-gear correspondence has one-to-one accuracy. The angle-gear is the correspondence between the angle range and the gear information. The angle range is divided according to the gear of a certain knob switch. One gear corresponds to a certain angle range. It is judged that the angle is within a certain angle range, and the gear pointed to by the indicating end area is obtained, thereby determining the gear of the knob switch. Specifically, according to the angle range corresponding to each gear, when the angle is within the angle range corresponding to a certain gear, it is judged that the knob switch handle is in a certain gear. The angle-gear correspondence can be manually edited and entered into the inspection platform in advance as a preset parameter.
[0050] The method provided by the embodiment of the present invention obtains the overall area of the knob switch and the indicating end area of the knob switch; obtains the line connecting the center of the overall area of the knob switch and the center of the indicating end area of the knob switch as the line to be tested; obtains the angle between the line to be tested and a preset reference line, and determines the gear position of the knob switch according to the angle, thereby achieving intelligent monitoring of the gear position state of the knob switch.
[0051] Example 2
[0052] See also Figure 5 , Embodiment 2 of the present invention provides a method for identifying the position of a knob switch, specifically, see Figure 5 The method for identifying the position of the knob switch includes the following steps S501-S507.
[0053] S501, obtaining a preset position map of the machine room inspection site.
[0054] In a specific implementation, the camera inspection preset position is set according to the best shooting angle; during inspection, the camera locks the inspection device according to the preset position information set for the inspection task to shoot, and obtains the corresponding preset position map.
[0055] S502, processing the preset bitmap by using a pre-trained instance segmentation algorithm to obtain pixel coordinates of the knob switch.
[0056] In a specific implementation, before obtaining the overall area of the knob switch and the indicating end area of the knob switch from the preset bitmap, the preset bitmap will be processed by a pre-trained instance segmentation algorithm to obtain the pixel coordinates of each switch and number them to provide reliable data for subsequent identification. Specifically, with the pixel coordinates as the reference system, all the knob switches in the preset bitmap are numbered by row and column from left to right and from top to bottom, and the corresponding knob switch pixel coordinates are associated. The number is the unique identifier of each knob switch in the system, and the subsequent recognition result is also associated with the number. The recognition result includes an identification of whether the recognition is successful and the switch gear information.
[0057] The pixel coordinates are used to describe the position, size and range of the knob switch area, and may be the four vertices of the circumscribed rectangle of the knob switch area, or the center point and the width and height of the knob switch area.
[0058] S503, saving the pixel coordinates of the knob switch in JSON format and storing them in a preset storage location.
[0059] In a specific implementation, the pixel coordinates of the knob switch are saved in JSON format, which is a lightweight data exchange format. It is based on a subset of ECMAScript (js specification developed by the European Computer Association) and uses a text format that is completely independent of the programming language to store and represent data. The concise and clear hierarchical structure makes JSON an ideal data exchange language. It is easy for people to read and write, and it is also easy for machines to parse and generate, and effectively improves network transmission efficiency. People in this professional field can customize the storage location of the storage according to actual needs. Specifically, the pixel coordinates contain the corresponding relationship between the coordinate identifier and the knob switch, and the corresponding relationship is stored in JSON format to avoid false detection and missed detection.
[0060] S504: Acquire the entire area of the knob switch and the indicating end area of the knob switch from the preset position map.
[0061] In a specific implementation, the trained instance segmentation algorithm model is called to extract the overall area of the knob switch and the indicating end area of the knob switch from the preset bitmap to obtain the overall area of the knob switch and the indicating end area of the knob switch.
[0062] In a specific implementation, the indication end region of the rotary knob switch includes a mark with obvious indication features, or the indication end region of the rotary knob switch includes a protruding handle of the rotary knob switch.
[0063] The above step S504 includes: based on the instance segmentation algorithm in the deep learning algorithm, the preset bitmap is identified to obtain the overall area of the knob switch and the indication end area of the knob switch.
[0064] In the specific implementation, when the trained instance segmentation algorithm model is called, the preset bitmap will be identified. The overall area of the knob switch in the image will be identified first, and then the indication end area will be identified from the overall area of the knob switch through identification, thereby obtaining an overall area of the knob switch and the indication end area of the knob switch.
[0065] S505: Determine the overall area and the indication end area of each knob switch based on the preset pixel coordinates of the knob switch.
[0066] In a specific implementation, if the number of the knob switches is greater than 1, the acquisition of the overall area of the knob switch and the indicating end area of the knob switch from the preset bitmap includes: based on the pixel coordinates of the preset knob switch, obtaining the corresponding relationship between each knob switch and the pixel coordinates, and recording the overall area and indicating end area of each knob switch on this corresponding relationship; using the pixel coordinates as a reference system, numbering the pixel coordinates in order from left to right and from top to bottom, so as to ensure that the knob switch to be tested forms a one-to-one relationship with the preset number, so that the gear position result of the intelligent monitoring knob switch has accuracy, rigor and uniqueness. Through the pixel coordinates, the gear position recognition result finally obtained should also be associated with the preset number. Specifically, based on the instance segmentation algorithm, the gear positions of each knob switch are identified. If the overall area and the indicating end area of the knob switch can be segmented, the recognition is successful and the gear position of the knob switch is obtained; if the overall area and the indicating end area of the knob switch cannot be segmented, the recognition fails and the recognition failure information is obtained.
[0067] In the specific implementation, the instance segmentation algorithm includes the following two methods to obtain the overall area and the indication end area of each knob switch:
[0068] First, perform an instance segmentation algorithm in the preset bitmap, first obtain the overall area and the indicator end area of each knob switch respectively, and then match them one by one. Specifically, call the trained instance segmentation algorithm model, extract the overall area of the knob switch and the indicator end area of the knob switch from the preset bitmap, and obtain the overall area of each knob switch and the indicator end area of the knob switch. The preset bitmap contains multiple knob switches, and the overlapping area between the overall area of each knob switch and the indicator end area is calculated. The overall area and the indicator end area of the knob switch with the largest overlapping area are attributed to the same knob switch, and a corresponding relationship is established. Then, the associated number is assigned according to the pixel coordinates;
[0069] Second, each knob switch is first intercepted from the preset bitmap, and then the instance segmentation algorithm is performed. Specifically, the preset bitmap is intercepted according to the pixel coordinates of the preset knob switch, and the region map of each knob switch is obtained respectively, the region map only contains one knob switch, and the overall region of the knob switch and the indicating end region of the knob switch are identified in the region map of the knob switch.
[0070] S506: Acquire a line connecting the center of the entire area of the rotary switch and the center of the indicating end area of the rotary switch as a line to be tested.
[0071] In a specific implementation, the overall area of the knob switch is the dial area of the knob switch or the handle area of the knob switch, and the indication end area of the knob switch is a part of the knob switch handle that is easy to identify, including a mark with obvious indication features or a protruding part of the handle. The above two areas are processed to obtain the center or center of gravity of the above two areas, and the two centers or center of gravity points are connected, and the obtained connecting line is the line to be measured. Specifically, the area on the handle with obvious indication features and the protruding part of the handle may be in opposite directions. Here, one of the areas can be selected as the indication end area, or a judgment can be made based on the two areas. This patent does not limit this.
[0072] S507, obtaining an angle between the line to be measured and a preset reference line, and determining a gear position of the knob switch according to the angle.
[0073] In a specific implementation, the reference line is a line connecting the center of the overall area of the preset knob switch and the center of the indicating end area of the knob switch. The line to be tested and the reference line can be extended until they intersect. Specifically, by the formula The angle between the line to be measured and the preset starting angle direction is obtained, where θ is the angle between the line to be measured and the preset starting angle direction, O(x o ,y o ) is the center coordinate of the overall area, A(x a ,y a ) is the center coordinate of the indicating end area. The value of θ can be combined with the preset angle range to obtain the gear position of the knob switch.
[0074] The method provided by the embodiment of the present invention, when there are multiple knob switches in the preset bitmap, firstly determines the correspondence between each knob switch and the pixel coordinates through pixel coordinates, attributes the overall area and the indication end area within the overall area to the same knob switch, determines the correspondence between the knob switch and the overall area and the indication end area within the overall area, obtains the overall area of the knob switch and the indication end area of the knob switch; obtains the line connecting the center of the overall area of the knob switch and the center of the indication end area of the knob switch as the line to be measured; then obtains the angle between the line to be measured and the preset reference line according to the correspondence, and determines the gear position of the knob switch according to the angle, thereby achieving the effect of intelligently monitoring the gear position state of the knob switch.
[0075] Example 3
[0076] See also Figure 6 , Figure 6 FIG. 1 is a structural block diagram of another identification device provided by an embodiment of the present invention. Figure 6 As described above, the embodiment of the present invention further provides an identification device 600 , which includes a first acquisition unit 601 , a second acquisition unit 602 , a third acquisition unit 603 , and a fourth acquisition unit 604 .
[0077] The first acquisition unit 601 is used to acquire a preset bitmap of the inspection site of the computer room.
[0078] The second acquisition unit 602 is used to acquire the entire area of the knob switch and the indicating end area of the knob switch.
[0079] The third acquisition unit 603 is used to acquire a line connecting the center of the entire area of the knob switch and the center of the indicating end area of the knob switch as a line to be measured.
[0080] The fourth acquisition unit 604 is used to acquire the angle between the line to be measured and the preset reference line, and determine the gear position of the knob switch according to the angle.
[0081] In one embodiment, the acquiring the entire area of the knob switch and the indicating end area of the knob switch from the preset bitmap includes:
[0082] Based on the instance segmentation algorithm in the deep learning algorithm, the preset bitmap is identified to obtain the overall area of the knob switch and the indication end area of the knob switch.
[0083] In one embodiment, the step of obtaining a line connecting a center of the entire area of the rotary switch and a center of an indication end area of the rotary switch as a line to be tested includes:
[0084] Acquire a first geometric center of an outer contour of the overall area and a second geometric center of an outer contour of the indication end area;
[0085] The first geometric center and the second geometric center are connected by a line segment to obtain the line to be measured.
[0086] In one embodiment, determining the gear position of the knob switch according to the angle includes:
[0087] The gear position corresponding to the angle is determined according to a preset angle-gear position correspondence relationship.
[0088] In one embodiment, the indicator end region of the rotary switch includes a characteristic mark, or the indicator end region of the rotary switch includes a protruding handle of the rotary switch.
[0089] Example 4
[0090] See also Figure 7 , Figure 7 FIG. 1 is a structural block diagram of another identification device provided by an embodiment of the present invention. Figure 7 As described above, the embodiment of the present invention further provides another identification device 700, which includes a first acquisition unit 701, a second acquisition unit 702, a first storage unit 703, a third acquisition unit 704, a first judgment unit 705, a fourth acquisition unit 706, and a fifth acquisition unit 707.
[0091] The first acquisition unit 701 is used to acquire a preset bitmap of the inspection site of the computer room.
[0092] The second acquisition unit 702 is used to process the preset bitmap through a pre-trained target detection model to obtain the pixel coordinates of the knob switch.
[0093] The first storage unit 703 is used to save the pixel coordinates of the knob switch in JSON format and store them in a preset storage location.
[0094] The third acquisition unit 704 is used to acquire the entire area of the knob switch and the indication end area of the knob switch from the preset bitmap.
[0095] The first determination unit 705 is used to determine the entire area and the indication end area of each knob switch based on the preset pixel coordinates of the knob switch.
[0096] The fourth acquisition unit 706 is used to acquire a line connecting the center of the entire area of the rotary switch and the center of the indicating end area of the rotary switch as a line to be measured.
[0097] The fifth acquisition unit 707 is used to acquire the angle between the line to be measured and the preset reference line, and determine the gear position of the knob switch according to the angle.
[0098] Example 5
[0099] like Figure 8 As shown, an embodiment of the present invention provides an electronic device, including a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0100] Memory 803, used for storing computer programs;
[0101] The processor 801 is used to implement the method for identifying the gear position of the knob switch provided by any one of the aforementioned method embodiments when executing the program stored in the memory 803.
[0102] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for identifying the gear position of a knob switch provided in any of the aforementioned method embodiments are implemented.
[0103] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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 process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0104] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for identifying the position of a knob switch, characterized in that: include: Obtain the preset location map of the equipment room inspection site; Acquire the entire area of the knob switch and the indicating end area of the knob switch from the preset position map; Obtaining a line connecting the center of the entire area of the knob switch and the center of the indicating end area of the knob switch as a line to be tested; Obtaining the angle between the line to be tested and a preset reference line, and determining the gear position of the knob switch according to the angle; The acquiring the entire area of the knob switch and the indicating end area of the knob switch from the preset bitmap comprises: identifying the preset bitmap based on an instance segmentation algorithm in a deep learning algorithm to obtain the entire area of the knob switch and the indicating end area of the knob switch; Before obtaining the entire area of the knob switch and the indicating end area of the knob switch from the preset bitmap, the method includes: processing the preset bitmap of the preset knob switch by a pre-trained instance segmentation algorithm to obtain the pixel coordinates of the knob switch; saving the pixel coordinates of the knob switch in a json format and storing them in a preset storage location; If the number of the rotary switches is greater than 1, the acquiring the entire area of the rotary switches and the indicating end area of the rotary switches from the preset bitmap includes: acquiring the entire area and the indicating end area of each rotary switch based on the preset pixel coordinates of the rotary switches; or attributing the entire area and the indicating end area within the entire area to the same rotary switch; The method of obtaining a line connecting the center of the overall area of the knob switch and the center of the indicating end area of the knob switch as a line to be measured includes: obtaining a first geometric center of an outer contour of the overall area and a second geometric center of an outer contour of the indicating end area; connecting the first geometric center and the second geometric center through a line segment to obtain the line to be measured.
2. The method for identifying the position of a rotary switch according to claim 1, characterized in that: Determining the gear position of the knob switch according to the included angle includes: The gear position corresponding to the angle is determined according to a preset angle-gear position correspondence relationship.
3. The method for identifying the position of a knob switch according to claim 1, characterized in that: The indicating end region of the rotary switch includes a characteristic mark, or the indicating end region of the rotary switch includes a protruding handle of the rotary switch.
4. An identification device, characterized in that: The invention comprises a unit for executing the method for identifying the gear position of a knob switch as claimed in any one of claims 1 to 3.
5. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the method for identifying the gear position of the knob switch as described in any one of claims 1 to 3 when executing the program stored in the memory.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for identifying the position of a knob switch as described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Device and method for intelligently detecting wiring state of multi-gear rotary switch
CN109031030A
Gear recognition method and system for knob switch
CN112116540A