Method for detecting color blocks and related products

By extracting the characteristic dimension information of the color patch in the automated control system and calculating the Mahalanobis distance, the distance between the color patch to be measured and the standard color patch is identified, which solves the problems of cumbersome identification process and poor versatility in the existing technology, and achieves Efficient and easy-to-use color patch identification method.

CN114066823BActive Publication Date: 2025-01-21SUIRUI TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111257516.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2025-01-21
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

The prior art requires a large number of samples training and identification processes in the judgment and monitoring of color block status in automated control systems, which limits the universality and ease of use of the method.

Method used

By acquiring the image of the status indication color patch, extracting the characteristic dimension information of the color patch, calculating the Mahalanobis distance between the color patch to be measured and the standard color patch, and identifying the color patch to be measured as the standard color patch with the closest feature value.

Benefits of technology

It does not require a large number of sample training, simplifies the recognition process, improves the versatility and ease of use of the color block recognition algorithm, and can effectively identify color blocks in different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066823B_ABST
    Figure CN114066823B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device, computer program product and system for detecting color blocks. The method comprises: obtaining an image of a state indicating color block, wherein the color block comprises a standard color block and a color block to be tested; extracting characteristic dimension information of each color block from the image; determining the characteristic value distance between the color block to be tested and each standard color block based on the characteristic dimension information; and identifying the color block to be tested as the standard color block with the closest characteristic value distance. Through the technical solution of the present invention, the recognition of color blocks in different application scenarios can be realized without introducing a large amount of sample training, thereby improving the versatility and ease of use of the color block recognition algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of digital image processing technology. More specifically, the present invention relates to a method, device, computer program product and system for detecting color blocks. Background Art

[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The descriptions herein may include concepts that may be explored, but not necessarily concepts that have been previously thought of or explored. Therefore, unless otherwise noted herein, the content described in this section is not prior art with respect to the specification and claims of this application, and is not admitted to be prior art by inclusion in this section.

[0003] In various automated control systems (such as power systems in distribution rooms), the safe operation of equipment is one of the most important safety guarantees, and the operating status of various equipment is an important guarantee for ensuring the safe operation of the system. Usually, the different colors of the color blocks in the display screen can be used to indicate the various operating states of the equipment, so the judgment and monitoring of the color block status is particularly important. For example, in the application scenario of the distribution room display screen, a few specific and limited standard colors are first given to represent different states, and the status indicator color block will be displayed in different colors among these colors according to the current state, so it is necessary to judge its state by detecting the standard color of the color block.

[0004] In the related art, color recognition mostly adopts machine learning. This method requires training of machine learning models for the colors of different color blocks, and using the trained models to identify and judge the state colors. In actual application, it not only requires a large number of diverse learning samples about application scenarios, but also is limited to the number of standard colors and the scene recognition of specific colors that are completely consistent with the training type, which makes the scope of use of this method very limited and the recognition process cumbersome. Summary of the invention

[0005] In order to at least solve the technical problems described in the above background technology section, the present invention proposes a solution for detecting color blocks. Using the solution of the present invention, it is possible to recognize color blocks in different application scenarios without introducing a large amount of sample training, so that the solution of the present invention can effectively improve the versatility and ease of use of the color block recognition algorithm. In view of this, the present invention provides solutions in the following aspects.

[0006] A first aspect of the present invention provides a method for detecting color blocks, comprising: acquiring an image of a status indicating color block, wherein the color blocks include a standard color block and a color block to be tested; extracting characteristic dimension information of each color block from the image; based on the characteristic dimension information, determining a characteristic value distance between the color block to be tested and each standard color block; and identifying the color block to be tested as a standard color block having the shortest characteristic value distance.

[0007] In one embodiment, the feature dimension information includes a feature value vector, and determining the feature value distance between the color block to be tested and each standard color block includes: calculating the Mahalanobis distance between the feature value vector of the color block to be tested and the feature value vector of each standard color block.

[0008] In one embodiment, wherein the standard color blocks and the color blocks to be tested include multiple feature dimensions, calculating the Mahalanobis distance between the eigenvalue vector of the color block to be tested and the eigenvalue vector of the standard color blocks includes: obtaining the eigenvalue vectors of the color block to be tested and the standard color blocks; obtaining a sample vector covariance matrix about the multiple feature dimensions; and determining the Mahalanobis distance based on the eigenvalue vectors of the color block to be tested and the standard color blocks and the sample vector covariance matrix.

[0009] In one embodiment, obtaining the eigenvalue vectors of the color block to be tested and the standard color blocks includes: obtaining the statistical mean of each feature dimension in the multiple feature dimensions; and determining the eigenvalue vectors of the standard color blocks and the color block to be tested based on the statistical mean of each feature dimension in the multiple feature dimensions.

[0010] In one embodiment, obtaining the sample vector covariance matrix about the multiple feature dimensions includes: obtaining the sample vectors of the multiple feature dimensions; and determining the sample vector covariance matrix based on the sample vectors of the multiple feature dimensions.

[0011] In one embodiment, the Mahalanobis distance is calculated according to the following formula:

[0012]

[0013] Wherein, E represents the eigenvalue vector of the color block to be tested, and E j represents the eigenvalue vector of the j-th standard color block, and C represents the covariance matrix of the sample vector.

[0014] In one embodiment, obtaining an image of a state indicating color block includes: obtaining a template image of the state indicating color block, wherein key area information about a color area of ​​the color block is marked in the template image;

[0015] Acquire an image to be tested about the state indicating color block; project the image to be tested into the template image to obtain an image to be identified; and extract images of each color block from the image to be identified based on the key area information.

[0016] In one embodiment, the key area information includes a key area for representing a minimum inscribed rectangle of a color block and vertex coordinates of the key area, and extracting images of each color block includes: extracting images of each color block from the image to be identified based on the vertex coordinates of the key area.

[0017] In one embodiment, the method further includes: acquiring and displaying the event state identified by the standard color block that is closest to the characteristic value.

[0018] The second aspect of the present invention provides a device for detecting color blocks, comprising: a processor; and a memory storing computer instructions for detecting color blocks, wherein when the computer instructions are executed by the processor, the device executes the method described in the first aspect above and in multiple embodiments below.

[0019] A third aspect of the present invention provides a computer program product, comprising computer instructions for detecting color blocks, and when the computer instructions are executed by the processor, the method described in the first aspect above and in multiple embodiments below is implemented.

[0020] The fourth aspect of the present invention provides a system for detecting color blocks, comprising: a status indication device, which is configured with a status indication color block for identifying an event status; and a device, which is configured to execute the method described in the first aspect above and in multiple embodiments below to realize the identification of the color block of the status indication device.

[0021] By using the solution provided by the present invention, the characteristic value distance between the standard color block and the color block to be tested in the image can be used to realize the recognition of the color block. It can be seen that the solution of the present invention mainly realizes color recognition in a numerical operation manner, without the need to introduce a large amount of sample data in advance, thereby greatly simplifying the entire recognition process. In some embodiments, the template image can also be replaced according to different scenes during the recognition process, so that the recognition of color blocks in different scenes can be completed, effectively improving the versatility and ease of use of the recognition algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 is an exemplary scene diagram showing a scheme for detecting color blocks in which the present invention is applied;

[0024] Figure 2 is a flow chart showing a method for detecting a color block according to an embodiment of the present invention;

[0025] Figure 3 is a flow chart showing an image of a state indicating color block obtained according to an embodiment of the present invention;

[0026] Figure 4 is a flow chart showing another method for detecting a color block according to an embodiment of the present invention; and

[0027] Figure 5 is a structural diagram showing a system for detecting color blocks according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] It should be understood that the terms "first", "second", "third" and "fourth" etc. in the claims, specifications and drawings of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0030] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the claims, the singular forms of "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in the specification of the present invention and the claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0031] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

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

[0033] Figure 1 1 is a diagram showing an exemplary scene 100 in which the scheme of detecting color blocks of the present invention is applied. In the context of the present invention, the aforementioned scene may be a scene of identifying color blocks in status indicating devices in various automated control systems. It is understood that the scheme of the present invention may support color block identification in different scenes (e.g., identification of color blocks in different status indicating devices and color block identification of the same status indicating device in different external scenes, etc.). Figure 1 The status indicating device 101 in the embodiment can be various central control display screens, or various devices capable of displaying color blocks (such as cabinets of power distribution systems, devices with various status indicator lights, etc.). It is understandable that the description of the status indicating device here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0034] In a specific application process, an image of a state indicating color block may be first collected, and then the standard color block and the color block to be tested in the image may be obtained. Then, the color block recognition is completed based on the characteristic value distance between the color block to be tested and each standard color block. In some embodiments, Figure 1 As shown, an image acquisition device (such as a camera, a video camera robot, etc.) can be used to acquire images, and then the acquired images can be sent to the device side ( Figure 1 The image acquisition and recognition process is only an exemplary description, and the solution of the present invention is not limited thereto. For example, a device supporting a camera function may be used to complete image acquisition and perform subsequent recognition processing.

[0035] Figure 2 FIG. 2 is a flow chart showing a method 200 for detecting a color block according to an embodiment of the present invention. It can be understood that the color block here can be the color block described in the previous text. Figure 1 Therefore, the above combined with the color block displayed by the status indicator device described above. Figure 1 The details described in also apply below.

[0036] In step S201, an image of a state indicating color block may be acquired, wherein the aforementioned color block may include a standard color block and a color block to be tested.

[0037] The above images can be obtained in many ways. Figure 3 Detailed steps for obtaining the aforementioned images in some embodiments are shown. Figure 3 As shown, at step S201-1, a template image of the aforementioned state indicating color block can be obtained. In some embodiments, the overall image of the state indicating device captured by an image acquisition device (e.g., a camera) can be obtained and used as a template image. Then, the rectangular area of ​​the state indicating color block is marked in the image as a key area. It can be understood that the description of obtaining the template image here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0038] Next, at step S201-2, the image to be tested about the aforementioned status indication color block can be obtained. In some embodiments, the image to be tested can also come from an external image acquisition device. Specifically, the image to be tested can be acquired under the same shooting conditions as the template image. The same shooting conditions as the template image can include the same image acquisition device acquiring the overall image of the status indication device at the same position from the status indication device. The image here can be a picture or a video.

[0039] Next, in step S201-3, the aforementioned image to be tested may be projected and transformed into a template image to obtain an image to be identified. In some embodiments, a projection matrix for transforming the image to be tested into the template image may be determined based on the image features of the template image and the image to be tested, and the image to be tested may be projected and transformed into the template image using the projection matrix. The aforementioned image features may include scale-invariant feature transform features (SIFT), accelerated robust features (SURF), and ORB (Oriented Fast and Rotated Brief) features, etc. It is to be understood that the description of the image to be tested here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0040] Finally, at step S201-4, the images of each color block can be extracted from the aforementioned image to be identified based on the key area information. In some embodiments, the aforementioned key area information may include a key area for representing the minimum inscribed rectangle of the color area of ​​the color block and the vertex coordinates of the key area. Based on this, the images of each color block can be extracted from the image to be identified based on the vertex coordinates of the aforementioned key area. It can be understood that the description of the extraction of key area information and color blocks here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0041] After completing the image acquisition, continue Figure 2 At step S202, feature dimension information of each color block can be extracted from the aforementioned image. In some embodiments, the aforementioned feature dimension information may include a feature value vector, such as a red component r, a green component g, a blue component b, a chromaticity h, a brightness v, and a saturation s. It should be noted that the description of the content and quantity of the feature dimension information here is only an exemplary description, and can be increased or decreased according to the calculation requirements.

[0042] Next, at step S203, the eigenvalue distance between the color block to be tested and each standard color block can be determined based on the aforementioned feature dimension information. In some embodiments, as described above, the feature dimension information can include an eigenvalue vector, which can be obtained by calculating the Mahalanobis distance between the eigenvalue vector of the color block to be tested and the eigenvalue vector of each standard color block. For example, when each standard color block and the color block to be tested include multiple feature dimensions, the eigenvalue vectors of the color block to be tested and each standard color block and the sample vector covariance matrix of the multiple feature dimensions can be obtained, and then the eigenvalue vectors of the color block to be tested and each standard color block and the sample vector covariance matrix are used to determine the Mahalanobis distance.

[0043] In some embodiments, the aforementioned Mahalanobis distance may be determined specifically by formula (1):

[0044]

[0045] Wherein, E in formula (1) represents the eigenvalue vector of the color block to be tested, and E j Represents the eigenvalue vector of the jth standard color block, and C represents the sample vector covariance matrix. In some embodiments, the statistical mean value of each feature dimension in multiple feature dimensions can be obtained, and the eigenvalue vectors of the aforementioned standard color blocks and the color block to be tested can be determined based on the aforementioned statistical mean value. The sample vector covariance matrix of the aforementioned feature dimension can be specifically determined based on the sample vectors of multiple feature dimensions. It can be understood that the description of the calculation process of the eigenvalue vector and the sample vector covariance matrix here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0046] In other embodiments, the Euclidean distance may be used to calculate the characteristic value distance between the color block to be tested and each standard color block. It should be noted that the solution of the present invention may preferably use the Mahalanobis distance to calculate the aforementioned characteristic value distance, which is conducive to improving the accuracy of color block recognition.

[0047] Next, at step S204, the aforementioned color block to be tested can be identified as the standard color block with the closest characteristic value distance to complete the identification of the color block. In some embodiments, as described above, the aforementioned color block to be tested can be identified as the standard color block with the closest Mahalanobis distance. Alternatively, the color block to be tested can also be identified as the standard color block with the closest Euclidean distance. It can be seen that the solution of the present invention mainly uses numerical calculations to achieve color recognition, without the need to introduce a large amount of sample data in advance, thereby greatly simplifying the entire recognition process, and also improving the versatility and ease of use of the recognition algorithm.

[0048] Furthermore, the event status identified by the standard color block with the closest characteristic value can also be obtained and displayed. In some embodiments, the event status (such as operation status, progress status, etc.) identified by the standard color block can be pre-stored, and the event status corresponding to the identified standard color block can be searched and displayed for display. For example, the event status can be displayed on the local side, or the event status can be pushed to a designated terminal so that relevant personnel can follow up in time.

[0049] Figure 4 FIG. 4 is a flow chart showing another method 400 for detecting a color block according to an embodiment of the present invention. It can be understood that the color block here can be the color block described in the previous text. Figure 1 The described status indicates the color block displayed by the device. In addition, Figure 4 It can also be combined with the previous text Figure 2 and Figure 3 A possible implementation of each step described. Figures 1 to 3 The detailed description also applies below.

[0050] like Figure 4 As shown, at step S401, an image of a state indicating color block may be input. In some embodiments, a template image of the state indicating color block and an image to be detected may be obtained, and then the image to be detected may be projected and transformed into the template image to obtain an image to be identified. The aforementioned color blocks include both n1 standard color blocks as standards and n2 detection color blocks indicating the state of the device to be detected, and the total number of color blocks is n=n1+n2.

[0051] In some embodiments, each specific image acquisition process may involve: S401-1. Before the actual detection, the whole image of the status indication device may be captured by a camera as a template image. Then, the rectangular area of ​​the status indication color block in the image (the area is the minimum inscribed rectangle of the color block color area) may be manually marked as the key area, and the 4 vertex coordinates of the n key areas may be recorded. The coordinates involved in the context of the present invention are based on the upper left corner vertex of the image as the starting point coordinate (1, 1), the horizontal coordinate increases to the right, and the vertical coordinate increases downward.

[0052] S401-2, during actual testing, the same camera is used to capture the entire image of the status indicator device at the same position as the image to be tested. The image features of the template image and the image to be tested are then calculated respectively, and the features of the two images are matched to obtain a projection matrix M from the test image to the template image.

[0053] S401-3, the image to be measured (x p ,y p ) is projected into the template image to obtain the image to be recognized (x t ,y t ). In some embodiments, it can be specifically calculated with reference to formula (2):

[0054]

[0055] Among them, in formula (2), (x t ′,y t ′) is the image coordinate after projection transformation without scaling, where k represents the scaling factor, which is generally selected as 1.

[0056] S401-4: In the aforementioned image to be recognized, n color blocks of images may be extracted according to the four vertex coordinates of the recorded n key areas.

[0057] Next, at step S402, the eigenvalues ​​of all color blocks can be calculated. For example, the dimension of the eigenvalues ​​of the aforementioned color blocks can be m (m≤n). Based on this, the dimension and specific content of the eigenvalues ​​include but are not limited to the following cases: when m=5, the red component r, green component g, blue component b, chroma h and brightness v of the color block are taken as eigenvalues ​​(in other cases such as when m=3, any three dimensions can be selected; when m=6, saturation s can be added as the sixth dimension, etc.). The eigenvalue vector E of a specific color block i i for The eigenvalues ​​of each dimension are the statistical averages of the corresponding dimensional components of the color block, including the red component Green Component Blue Component Chroma brightness The specific calculation formula (3) is as follows:

[0058]

[0059] Where i = 1, 2, ..., n, M i is the number of pixels in the horizontal direction of color block i, N i is the number of pixels in the vertical direction of color block i. x is the horizontal coordinate of the pixel point of the color block, y is the vertical coordinate of the pixel point of the color block, and r i(x, y), g i (x, y), b i (x, y), h i (x, y) and v i (x, y) are the red component value, green component value, blue component value, chromaticity value and brightness value of pixel point (x, y) of color block i respectively.

[0060] Next, at step S403, the sample vector covariance matrix of m feature dimensions may be calculated. In some embodiments, sample vectors of m feature dimensions may be obtained. Taking m=5 selected in step S402 as an example, the red component feature sample vector R, the green component feature sample vector G, the blue component feature sample vector B, the chromaticity feature sample vector H, and the brightness feature sample vector V are respectively:

[0061] R=[R1 R2 ... R n-1 R n ]

[0062] G=[G1 G2 ... G n-1 G n ]

[0063] B=[B1 B2 ... B n-1 B n ]

[0064] H=[H1 H2 ... H n-1 H n ]

[0065] V=[V1 V2 ... V n-1 V n ]

[0066] The values ​​in the sample vector are derived from the statistical average values ​​of each dimension obtained in step 402:

[0067]

[0068] After completing the acquisition of sample vectors of m feature dimensions, the covariance matrix can be calculated. Specifically, the covariance matrix C of sample vectors of m feature dimensions is as follows:

[0069]

[0070] Among them, the covariance of any dimension X and Y is formula (4):

[0071]

[0072] Next, at step S404, the Mahalanobis distance between the color block to be tested and the standard color block may be calculated. In some embodiments, the specific algorithm of the aforementioned Mahalanobis distance may refer to Figure 2 The relevant parts are described in , which will not be repeated here.

[0073] Next, at step S405, the standard color block with the minimum Mahalanobis distance may be output as the final recognition result. In some embodiments, the minimum value D of the Mahalanobis distance between the color block to be tested and all the standard color blocks may be obtained. l (D l =min(D1, D2, ... D n1-1 , D n1 )), where n1 is the number of standard color blocks. l The color of the corresponding color block is the recognized color. Furthermore, the indication state corresponding to the standard color block can also be output.

[0074] Based on the above color block recognition process, the color of color blocks in different scenes can be recognized by taking corresponding template images for different scenes without adjusting the algorithm. In addition, it is not necessary to obtain a large amount of sample data in advance during the color recognition process, thereby simplifying the recognition process and improving the ease of use and versatility in actual use.

[0075] It should be noted that the formula used in the above calculation process is only an exemplary description and does not limit the solution of the present invention.

[0076] Figure 5 is a schematic block diagram showing a system 500 for detecting color blocks according to an embodiment of the present invention. The system 500 for detecting color blocks may include a state indicating device ( Figure 5 ), according to an embodiment of the present invention, and its peripheral devices and external networks. Among them, the status indication device is configured with a status indication color block for identifying the event status. In some embodiments, it can be a device that can display the status indication color block. For example, it can be a device that displays the status indication color block through a display screen (such as a distribution room cabinet, monitoring equipment, etc.). The device 501 implements color block recognition based on the characteristic value distance between the standard color block and the color block to be tested in the image, so as to realize the aforementioned combination Figures 2 to 4 The scheme of the present invention.

[0077] like Figure 5As shown in , the device 501 may include a CPU 5011, which may be a general-purpose CPU, a dedicated CPU, or other information processing and program execution units. Further, the device 501 may also include a large-capacity memory 5012 and a read-only memory ROM 5013, wherein the large-capacity memory 5012 may be configured to store various types of data and various programs required for calculating the characteristic value distance, and the ROM 5013 may be configured to store the power-on self-test of the device 501, the initialization of each functional module in the system, the basic input / output driver of the system, and the data required for booting the operating system.

[0078] Further, the device 501 also includes other hardware platforms or components, such as the TPU (Tensor Processing Unit) 5014, GPU (Graphic Processing Unit) 5015, FPGA (Field Programmable Gate Array) 5016 and MLU (Memory Logic Unit) 5017 shown. It is understood that although a variety of hardware platforms or components are shown in the device 501, this is merely exemplary and not restrictive, and those skilled in the art can add or remove corresponding hardware according to actual needs. For example, the device 501 may include only a CPU as a known hardware platform and another hardware platform as a test hardware platform of the present invention.

[0079] The device 501 of the present invention also includes a communication interface 5018, so that it can be connected to a local area network / wireless local area network (LAN / WLAN) 505 through the communication interface 5018, and then connected to a local server 506 or to the Internet ("Internet") 507 through the LAN / WLAN. Alternatively or additionally, the device 501 of the present invention can also be directly connected to the Internet or a cellular network through the communication interface 5018 based on wireless communication technology, such as wireless communication technology based on the third generation ("3G"), the fourth generation ("4G") or the fifth generation ("5G") . In some application scenarios, the device 501 of the present invention can also access a server 508 of an external network and a possible database 509 as needed.

[0080] The peripheral devices of the device 501 may include a display device 502, an input device 503, and a data transmission interface 504. In one embodiment, the display device 502 may include, for example, one or more speakers and / or one or more visual displays. The input device 503 may include, for example, a keyboard, a mouse, a microphone, a gesture capture camera, or other input buttons or controls, which are configured to receive input or user instructions for data. The data transmission interface 504 may include, for example, a serial interface, a parallel interface, or a universal serial bus interface ("USB"), a small computer system interface ("SCSI"), a serial ATA, a FireWire ("FireWire"), a PCI Express, and a high-definition multimedia interface ("HDMI"), etc., which are configured for data transmission and interaction with other devices or systems.

[0081] The CPU 5011, the mass storage 5012, the read-only memory ROM 5013, the TPU 5014, the GPU 5015, the FPGA 5016, the MLU 5017 and the communication interface 5018 of the device 501 of the present invention can be connected to each other through a bus 5019, and data interaction with peripheral devices can be achieved through the bus. In one embodiment, through the bus 5019, the CPU 5011 can control other hardware components in the device 501 and its peripheral devices.

[0082] During operation, the processor CPU 5011 of the device 501 of the present invention can obtain the image of the status indication color block through the input device 503 or the data transmission interface 504, and call the computer program instructions or codes stored in the memory 5012 to process the image to complete the recognition of the color block.

[0083] As can be seen from the above description of the modular design of the present invention, the system of the present invention can be flexibly arranged according to the application scenario or demand without being limited to the architecture shown in the accompanying drawings. Further, it should also be understood that any module, unit, component, server, computer or device that performs the operation of the example of the present invention may include or otherwise access a computer-readable medium, such as a storage medium, a computer storage medium or a data storage device (removable) and / or non-removable) such as a disk, an optical disk or a tape. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data. Based on this, the present invention also discloses a computer-readable storage medium, on which computer-readable instructions for detecting color blocks are stored, and when the computer-readable instructions are executed by one or more processors, the method and operation described in conjunction with the accompanying drawings are implemented.

[0084] Although this specification has shown and described a plurality of embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will appreciate many changes, modifications and alternatives without departing from the thought and spirit of the present invention. It should be understood that in the process of practicing the present invention, various alternatives to the embodiments of the present invention described herein may be adopted. The attached claims are intended to define the scope of protection of the present invention, and therefore cover the modular compositions, equivalents or alternatives within the scope of these claims.

Claims

1. A method for detecting a color block, characterized in that: include: Acquire an image of a state indicating color block, wherein the color block includes a standard color block and a color block to be tested, wherein a template image of the state indicating color block is acquired, wherein the template image is annotated with key area information about the color area of ​​the color block, acquire an image to be tested of the state indicating color block, project the image to be tested into the template image to obtain an image to be identified, and extract images of each color block from the image to be identified based on the key area information, wherein the image to be tested is acquired using the same shooting conditions as the template image; Extracting characteristic dimension information of each color block from the image; Based on the characteristic dimension information, determining the characteristic value distance between the color block to be tested and each standard color block; and The color block to be tested is identified as the standard color block with the closest characteristic value distance.

2. The method according to claim 1, characterized in that The characteristic dimension information includes a characteristic value vector, and determining the characteristic value distance between the color block to be tested and each standard color block includes: The Mahalanobis distance between the eigenvalue vector of the color block to be tested and the eigenvalue vectors of each standard color block is calculated.

3. The method according to claim 2, characterized in that The standard color blocks and the color blocks to be tested include multiple feature dimensions, and calculating the Mahalanobis distance between the feature value vector of the color block to be tested and the feature value vector of each standard color block includes: Obtaining the characteristic value vectors of the color block to be tested and the standard color blocks; Obtaining a sample vector covariance matrix with respect to the plurality of feature dimensions; and The Mahalanobis distance is determined based on the eigenvalue vectors of the color block to be tested and the standard color blocks and the sample vector covariance matrix.

4. The method according to claim 3, characterized in that Wherein obtaining the characteristic value vectors of the color block to be tested and the standard color blocks comprises: Obtaining a statistical average value of each feature dimension in the multiple feature dimensions; and Based on the statistical average value of each feature dimension in the multiple feature dimensions, the feature value vectors of the standard color blocks and the color block to be tested are determined.

5. The method according to claim 3, characterized in that: Wherein obtaining the sample vector covariance matrix about the multiple feature dimensions includes: Obtaining sample vectors of the multiple feature dimensions; and Based on the sample vectors of the multiple feature dimensions, the sample vector covariance matrix is ​​determined.

6. The method according to claim 3, characterized in that The Mahalanobis distance is calculated according to the following formula: Wherein, E represents the eigenvalue vector of the color block to be tested, and E j represents the eigenvalue vector of the j-th standard color block, and C represents the covariance matrix of the sample vector.

7. The method according to claim 1, characterized in that The key area information includes a key area for representing a minimum inscribed rectangle of a color block color area and vertex coordinates of the key area, wherein extracting images of each color block includes: The images of each color block are extracted from the image to be recognized according to the vertex coordinates of the key area.

8. The method according to claim 1, characterized in that Also includes: The event state identified by the standard color block closest to the characteristic value is obtained and displayed.

9. A device for detecting color blocks, characterized in that: include: processor; as well as A memory storing computer instructions for detecting color blocks, wherein when the computer instructions are executed by the processor, the device executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image identification-based intelligent transformer substation state monitoring system

    CN102412627A

  • Signal indicating lamp state detection method and device, and driving control method and device

    CN112016344A