A method, device, terminal and storage medium for determining instrument status

By calculating the color channel, low frequency and detail similarity of the instrument image, the inspection robot can realize universal recognition of different instrument states, solve the problem of lack of universality of the algorithm in the existing technology, improve the accuracy and simplify the recognition reduce design complexity.

CN113554017BActive Publication Date: 2024-08-23SHENZHEN LAUNCH DIGITAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110687925.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-21
Publication Date
2024-08-23
Estimated Expiration
2041-06-21

AI Technical Summary

Technical Problem

In the existing technology, when the inspection robot identifies the status of the instruments in the power distribution room, it needs to design an algorithm separately for each instrument, resulting in a lack of universality in the recognition algorithm. As the diversity of instruments increases, the algorithm design becomes more complicated.

Method used

By obtaining the image to be recognized and the reference image, the original image similarity, low-frequency similarity and detail similarity under each color channel are calculated, and the instrument status is determined based on these similarities to achieve universal recognition of different instrument status.

Benefits of technology

It improves the universality and accuracy of instrument status recognition, simplifies algorithm design, and is suitable for instrument status represented by different colors, characters, symbols and other information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113554017B
    Figure CN113554017B
Patent Text Reader

Abstract

The present application is applicable to the field of image processing, and provides a method, device, terminal and storage medium for determining the status of an instrument. The above-mentioned method for determining the status of an instrument includes: obtaining an image to be identified by photographing the instrument; obtaining a reference image; determining the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel; based on the original image similarity, low-frequency similarity, detail similarity of the image to be identified and the reference image in each color channel and the reference instrument status corresponding to the reference image, determining the instrument status of the instrument. The embodiments of the present application can improve the universality of instrument status recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method, device, terminal and storage medium for determining an instrument status. Background Art

[0002] A power distribution room refers to an indoor power distribution site with low-voltage loads, which mainly distributes electricity to low-voltage users. With the development of science and technology, inspection robots are increasingly used in power distribution rooms, and can gradually replace human inspections in an automated and intelligent manner.

[0003] One of the tasks of the inspection robot is to identify the current status of various types of instruments in the distribution room. Generally, the status of the instrument is represented by characters, symbols, colors and other elements. When identifying the status of the instrument, it is currently necessary to use a corresponding algorithm for each instrument, and the recognition algorithm is not universal. Summary of the invention

[0004] The embodiments of the present application provide a method, device, terminal and storage medium for determining an instrument state, which can improve the universality of instrument state identification.

[0005] A first aspect of an embodiment of the present application provides a method for determining an instrument status, including:

[0006] Acquire an image to be identified by photographing the instrument;

[0007] Get a reference image;

[0008] Determine the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel;

[0009] The instrument state of the instrument is determined based on the original image similarity, the low-frequency similarity, the detail similarity in each color channel between the image to be identified and the reference image and the reference instrument state corresponding to the reference image.

[0010] A second aspect of an embodiment of the present application provides a device for determining an instrument state, including:

[0011] The image acquisition unit to be identified is used to acquire the image to be identified obtained by photographing the instrument;

[0012] A reference image acquisition unit, used for acquiring a reference image;

[0013] A similarity determination unit, used to determine the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel;

[0014] The instrument state determination unit is used to determine the instrument state of the instrument based on the original image similarity, the low-frequency similarity, the detail similarity and the reference instrument state corresponding to the reference image between the image to be identified and the reference image in each color channel.

[0015] A third aspect of an embodiment of the present application provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0016] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0017] A fifth aspect of an embodiment of the present application provides a computer program product, which, when executed on a terminal, enables the terminal to implement the steps of the method.

[0018] In the implementation manner of the present application, by determining the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel; and based on the original image similarity, low-frequency similarity, detail similarity of the image to be identified and the reference image in each color channel and the reference instrument state corresponding to the reference image, the instrument state of the instrument is determined, so that the color, details and smoothed low-frequency information are taken into account in the process of identifying the instrument state, so that the scheme can be applied to instruments that use different colors, characters, symbols and other information to represent different instrument states, thereby improving the universality of instrument state recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0020] Figure 1 It is a schematic diagram of an implementation flow of a method for determining an instrument status provided in an embodiment of the present application;

[0021] Figure 2 It is a schematic diagram of a specific implementation process of determining detail similarity provided in an embodiment of the present application;

[0022] Figure 3 It is a schematic diagram of a specific implementation flow of step S201 provided in an embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of a specific implementation flow of step S203 provided in an embodiment of the present application;

[0024] Figure 5 It is a schematic diagram of a specific implementation process of determining detail similarity provided in an embodiment of the present application;

[0025] Figure 6 It is a schematic diagram of a specific implementation process of determining low-frequency similarity provided in an embodiment of the present application;

[0026] Figure 7 It is a schematic diagram of a specific implementation process of determining the instrument status provided in an embodiment of the present application;

[0027] Figure 8 This is a schematic diagram of a first effect of identifying the instrument status provided by an embodiment of the present application;

[0028] Fig. 9 This is a schematic diagram of a second effect of identifying the instrument status provided by an embodiment of the present application;

[0029] Fig.10 This is a schematic diagram of a third effect of identifying the instrument status provided by an embodiment of the present application;

[0030] Fig.11 It is a structural schematic diagram of a device for determining an instrument state provided in an embodiment of the present application;

[0031] Fig.12 It is a schematic diagram of the structure of the terminal provided in the embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0033] A power distribution room refers to an indoor power distribution site with low-voltage loads, which mainly distributes electricity to low-voltage users. With the development of science and technology, inspection robots are increasingly used in power distribution rooms, and can gradually replace human inspections in an automated and intelligent manner.

[0034] One of the tasks of the inspection robot is to identify the current status of various types of instruments in the distribution room. Generally, the instrument status of the instrument is represented by characters, symbols, colors and other elements. For example, the characters "ON" and "OFF" in the instrument represent the on state and the off state respectively; for another example, the symbol "OK" and the symbol "OK" in the instrument represent the normal state and the abnormal state respectively.

[0035] When identifying the status of an instrument, currently, it is necessary to use a corresponding algorithm for each instrument, and the recognition algorithm is not universal. Accordingly, as the diversity of instruments increases, the algorithm design and implementation of the inspection robot will become more complicated.

[0036] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0037] Figure 1 The present invention provides a schematic diagram of the implementation process of a method for determining the status of an instrument provided in an embodiment of the present invention, which can be applied to a terminal and can be applied to situations where the universality of the identification of the status of an instrument needs to be improved. The terminal can be a smart phone, a computer or other device.

[0038] Specifically, the above-mentioned method for determining the instrument status may include the following steps S101 to S104.

[0039] Step S101, obtaining an image to be recognized by photographing the instrument.

[0040] The above-mentioned instrument is used to display the corresponding instrument status according to the current environment. In the implementation of the present application, the above-mentioned instrument can have at least two instrument states, and each instrument state represents a different state of a certain parameter of the current environment.

[0041] The above-mentioned image to be identified refers to an image obtained by photographing the instrument, and may be an image obtained by photographing the instrument by an inspection robot or a surveillance camera installed near the instrument.

[0042] In the implementation manner of the present application, in order to automatically identify the status of the instrument, the terminal may identify the status of the instrument in the image to be identified based on the acquired image to be identified.

[0043] Step S102, obtaining a reference image.

[0044] The reference image is an image obtained by photographing an instrument whose instrument state is known. In some embodiments of the present application, the reference image corresponds to a reference instrument state, which is the instrument state of the instrument in the reference image.

[0045] In the implementation manner of the present application, by comparing the image to be identified with the reference image, it can be determined whether the instrument in the image to be identified and the instrument in the reference image are in the same instrument state.

[0046] It should be noted that this application does not limit the method for obtaining the reference image.

[0047] In some implementations of the present application, the terminal may adjust environmental parameters related to the instrument to put the instrument in a specific instrument state, and photograph the instrument to obtain a reference image and a reference instrument state associated with the reference image.

[0048] In some other implementations of the present application, the terminal may also directly photograph the instrument to obtain a reference image, and manually mark the reference instrument status according to the image content in the reference image.

[0049] Step S103, determining the original image similarity, low frequency similarity and detail similarity of the image to be identified and the reference image in each color channel.

[0050] The above-mentioned original image similarity refers to the similarity between the image to be identified and the reference image in each channel.

[0051] The above-mentioned low-frequency similarity refers to the similarity between the low-frequency information corresponding to the image to be identified and the low-frequency information corresponding to the reference image in each channel. The low-frequency information of the image to be identified can represent the image information of the image to be identified at a low resolution. Similarly, the low-frequency information of the reference image can represent the image information of the reference image at a low resolution.

[0052] The above-mentioned detail similarity refers to the similarity between the image content after detail enhancement of the image to be identified and the image content after detail enhancement of the reference image in each channel. Detail enhancement can highlight the overall or local characteristics of interest in the image and expand the imaging differences between different objects or regions in the image.

[0053] In an embodiment of the present application, after obtaining the image to be identified and the reference image, image processing and similarity calculation can be performed on the image to be identified and the reference image respectively to obtain the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel, and the instrument status of the instrument in the image to be identified is determined based on the original image similarity, low-frequency similarity and detail similarity.

[0054] Step S104, determining the instrument state of the instrument based on the original image similarity, low frequency similarity, detail similarity of the image to be identified and the reference image in each color channel and the reference instrument state corresponding to the reference image.

[0055] In some embodiments of the present application, based on the original image similarity, low-frequency similarity, and detail similarity of the image to be identified and the reference image in each color channel, the similarity between the image to be identified and the reference image in the original image, low-frequency information, and detail information can be determined, and then it can be determined whether the instrument in the image to be identified and the instrument in the reference image are in the same state.

[0056] That is, if the image to be identified and the reference image are similar in original image, low-frequency information and detail information based on the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel, it can be determined that the instrument state of the instrument in the image to be identified is the same as the reference instrument state. If it is determined that the image to be identified and the reference image are not similar in original image, low-frequency information and detail information, it can be determined that the instrument state of the instrument in the image to be identified is different from the reference instrument state.

[0057] In the implementation manner of the present application, by determining the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel; and based on the original image similarity, low-frequency similarity, detail similarity of the image to be identified and the reference image in each color channel and the reference instrument state corresponding to the reference image, the instrument state of the instrument is determined, so that the color, details and smoothed low-frequency information are taken into account in the process of identifying the instrument state, so that the scheme can be applied to instruments that use different colors, characters, symbols and other information to represent different instrument states, thereby improving the universality of instrument state recognition.

[0058] Specifically, Figure 2 As shown, in some implementations of the present application, the determination of the above-mentioned detail similarity may include the following steps S201 to S203.

[0059] Step S201 : performing detail enhancement processing on the image to be identified to obtain a first detail image of the image to be identified.

[0060] In some embodiments of the present application, Figure 3 As shown, the above-mentioned detail enhancement process may specifically include the following steps S301 to S303.

[0061] Step S301 , performing Gaussian filtering processing on the image to be identified for a preset number of times to obtain multiple Gaussian filtered images of the image to be identified.

[0062] The specific value of the preset number of times can be adjusted according to actual conditions, and the convolution kernel size and variance value corresponding to each Gaussian filtering process are increased successively.

[0063] In some embodiments of the present application, by performing multiple different Gaussian filtering processes on the image to be identified, a Gaussian filtered image can be obtained each time the Gaussian filtering process is performed. In the Gaussian filtered image, the pixel value of each pixel is determined by itself and other pixels in the neighborhood. Based on the difference in convolution kernel size and variance value, the Gaussian filtered image obtained each time is different.

[0064] Specifically, in some embodiments of the present application, each pixel in the image can be scanned in sequence according to a convolution kernel (template) of a specific size, and then the pixel average of the pixels in the neighborhood can be calculated according to the variance and the two-dimensional Gaussian filter function as the pixel value of the center pixel of the template.

[0065] Taking the preset number of times as 3 as an example, the convolution kernel G corresponding to the 3 Gaussian filtering processes is 1 , G 2 and G 3 The sizes of can be 5×5, 9×9 and 19×19 respectively; accordingly, the variances corresponding to the three Gaussian filtering processes can be 1, 2 and 4 respectively. Let the image to be identified be I, then the three Gaussian filtering images B obtained by the three Gaussian filtering processes are 1 , B 2 and B 3 In order: B 1 =G 1 *I, B 2 =G 2 *I, and B 3 =G 3 *I.

[0066] Step S302, based on the image to be identified and the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified, extract the first detail image to be fused, and based on the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified and the Gaussian filtered image obtained by performing the second Gaussian filtering process on the image to be identified, extract the second detail image to be fused, and so on, to obtain a first number of detail images to be fused.

[0067] The first number and the preset number of times are equal.

[0068] Specifically, the pixel values ​​of the image to be identified and the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified can be subtracted to obtain the first image to be fused, and then the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified and the Gaussian filtered image obtained by performing the second Gaussian filtering process on the image to be identified can be subtracted to obtain the second image to be fused, and so on, and the detail enhancement scales of each image to be fused finally obtained are different.

[0069] Take the preset number of times as 3 as an example to obtain 3 Gaussian filter images B 1 , B 2 and B 3 Afterwards, the Gaussian filter image B obtained by performing the first Gaussian filter processing on the image to be identified is obtained according to the image to be identified I. 1 , we can extract the first image D to be fused 1 =IB 1 ; Based on the Gaussian filter image B obtained by the first Gaussian filter processing of the image to be identified 1 and the Gaussian filter image B obtained by performing the second Gaussian filter on the image to be identified 2 , the second detail image D to be fused can be extracted 2 =B 1 -B 2 ; Based on the Gaussian filter image B obtained by performing the second Gaussian filter processing on the image to be identified 2 and the Gaussian filter image B obtained by performing the third Gaussian filter on the image to be identified 3 , the third detail image D to be fused can be extracted 3 =B 2 -B 3 ; Finally, three detail images to be fused can be obtained.

[0070] Step S303: weighted fusion is performed on a first number of detail images to be fused to obtain a first detail image of the image to be recognized.

[0071] Specifically, in some embodiments of the present application, the first detail image D of the image to be identified is (1-ω 1 ×sgn(D 1 ))×D 1 +ω 2 ×D 2 +...+ω n ×D n . Wherein, ω represents the weight of the image to be fused D, and the weight value corresponding to each image to be fused can be adjusted according to the actual situation. n represents the first number. sgn(D 1 ) is D 1 The sign function of D 1 When the value of is greater than 0, the sign function output is 1. 1 When the value of is equal to 0, the sign function output is 0. 1 When the value of is less than 0, the sign function output is -1.

[0072] Since the first image to be fused D 1 is the image to be identified and the Gaussian filtered image B obtained by performing the first Gaussian filtering on the image to be identified 1is obtained by subtracting, when the pixel value difference near the edge is expanded, the pixel value may be saturated due to its excessive overshoot. 1 The weight is (1-ω 1 ×sgn(D 1 )) to reduce D 1 The positive component in D 1 , to suppress saturation while enhancing detail.

[0073] Taking the preset number of times as 3 (ie, the first number is 3) as an example, the first detail image may be D=(1-0.5×sgn(D 1 ))×D 1 +0.5×D 2 +0.25×D 3 .

[0074] Step S202: Perform detail enhancement processing on the reference image to obtain a second detail image of the reference image.

[0075] In some embodiments of the present application, it is necessary to perform detail enhancement processing on the reference image in the same manner as performing detail enhancement processing on the image to be identified, so as to obtain a second detail image of the reference image. The specific implementation of detail enhancement processing on the reference image can refer to the description of step S201 above, and this application will not elaborate on this.

[0076] Step S203, calculating the first structural similarity between the first detail image and the second detail image in each color channel, and taking the first structural similarity between the first detail image and the second detail image in each color channel as the detail similarity between the image to be identified and the reference image in each color channel.

[0077] Specifically, a single channel is used as an example for explanation. In some implementations of the present application, Figure 4 As shown, the step of calculating the structural similarity under a single color channel may include the following steps S401 to S404.

[0078] Step S401, obtaining a first image region obtained each time the sliding window slides on the first detail image, and a second image region obtained each time the sliding window slides on the second detail image.

[0079] In some embodiments of the present application, the shape of the sliding window and the sliding step length of each sliding that are preset can be obtained, and the sliding window is set on the first detail image according to the shape of the sliding window to obtain a first first image area. Then, the sliding window is slid on the first detail image according to the sliding step length, and a new first image area can be obtained each time it is slid.

[0080] It should be noted that, when the image size of the first detail image is small, the sliding step size may be 0. Therefore, in some embodiments of the present application, at least one first image region may be finally obtained according to the size of the first detail image.

[0081] Similarly, based on the same sliding window and sliding step size, a sliding window can be set and slid on the second detail image to obtain at least one second image region.

[0082] Step S402, based on the first pixel value of each pixel point in the first image area under a single color channel, and the second pixel value of each pixel point in the second image area corresponding to the first image area under a single color channel, calculate the regional similarity between each first image area and the second image area corresponding to the first image area.

[0083] Specifically, Figure 5 As shown, the above-mentioned method for calculating the region similarity may include the following steps S501 to S505.

[0084] Step S501, determining a first pixel value mean value and a first pixel value standard deviation of the first image area in a single color channel according to a first pixel value of each pixel point in the first image area in a single color channel.

[0085] Specifically, in some embodiments of the present application, the first average pixel value of the first image area in the above single color channel is Among them, x i represents the pixel value of the i-th pixel in the first image region under the above single color channel, and N is the total number of pixels in the first image region. The standard deviation of the first pixel value in the first image region under the above single color channel

[0086] Step S502, determining a second pixel value mean value and a second pixel value standard deviation of the second image area in a single color channel according to the second pixel value of each pixel point in the second image area in a single color channel.

[0087] Similarly, the second average pixel value of the second image area under the above single color channel is Among them, y i represents the pixel value of the i-th pixel in the second image region under the above single color channel, and N is the total number of pixels in the second image region. The standard deviation of the second pixel value in the second image region under the above single color channel

[0088] Step S503: Calculate the pixel value covariance between the first image region and the corresponding second image region according to the first pixel value mean and the second pixel value mean.

[0089] Specifically, in some embodiments of the present application, based on the first pixel value mean μ x and the second pixel value mean μ y , the pixel value covariance between the first image region and the corresponding second image region can be calculated

[0090] Step S504: Calculate a brightness comparison value between the first image region and the corresponding second image region according to the first pixel value mean and the second pixel value mean.

[0091] In some embodiments of the present application, the brightness comparison value between the first image area and the second image area may represent a brightness difference at a certain pixel position between the first image area and the second image area.

[0092] Specifically, the brightness comparison value

[0093] Among them, C 1 =(K 1 ×L) 2 , C 1 It is used to avoid instability caused when the denominator is close to 0. L represents the grayscale level of the image. In some embodiments of the present application, K 1 It can be set to 0.01 and L can be set to 225.

[0094] Step S505: Calculate a contrast comparison value between the first image region and the corresponding second image region according to the first pixel value standard deviation and the second pixel value standard deviation.

[0095] In some embodiments of the present application, the contrast comparison value between the first image region and the second image region may represent a contrast difference at a certain pixel position between the first image region and the second image region.

[0096] Specifically, the above contrast comparison value

[0097] Among them, C 2 =(K 2 ×L) 2 , C2 is also used to avoid instability caused when the denominator is close to 0. In some embodiments of the present application, K 2 Can be set to 0.03.

[0098] Step S506: Calculate a structural comparison value between the first image region and the corresponding second image region according to the first pixel value standard deviation, the second pixel value standard deviation, and the pixel value covariance.

[0099] In some embodiments of the present application, the structural comparison value between the first image region and the second image region may represent a structural difference at a certain pixel position between the first image region and the second image region.

[0100] Specifically, the above structure comparison value

[0101] in,

[0102] Step S507: calculating the region similarity between the first image region and the second image region according to the brightness comparison value, the contrast comparison value and the structure comparison value.

[0103] In some embodiments of the present application, the regional similarity between the first image region and the second image region can be calculated based on the brightness comparison value I(x, y), the contrast comparison value C(x, y) and the structure comparison value S(x, y).

[0104] Among them, α, β, and γ are all 1.

[0105] Step S403, determining a first total number of target image regions, where the target image regions are first image regions whose region similarity is greater than or equal to a first similarity threshold, or the target image regions are second image regions whose region similarity is greater than or equal to the first similarity threshold.

[0106] The first similarity threshold is the lowest region similarity between the first image region and the second image region when the first image region and the second image region are structurally similar under a certain color channel.

[0107] When the regional similarity between the first image region and the second image region is greater than or equal to a first similarity threshold, it indicates that the first image region and the second image region are structurally similar; conversely, when the regional similarity between the first image region and the second image region is less than the first similarity threshold, it indicates that the first image region and the second image region are not structurally similar.

[0108] In some embodiments of the present application, the regional similarity calculation may be performed on each first image region and the corresponding second image region in turn, and after each regional similarity calculation, the first image region (or second image region) whose regional similarity is greater than or equal to the first similarity threshold is used as the target image region. After completing the similarity calculation between all first image regions and the corresponding second image regions, the first total number of target image regions may be obtained by counting.

[0109] Step S404: taking the ratio of the first total number to the second total number as the first structural similarity of a single color channel.

[0110] The second total number may be the total number of the first image regions, or the second total number may be the total number of the second image regions.

[0111] In some implementations of the present application, after the last sliding of the sliding window is completed, the total number of the first image areas or the total number of the second image areas may be counted, and the total number may be used as the second total number.

[0112] Then, the ratio of the first total number to the second total number may be used as the first structural similarity of the single color channel.

[0113] That is to say, the proportion of the image area that is relatively similar to the second detail image in the entire first detail image under a single color channel, or the proportion of the image area that is relatively similar to the first detail image in the entire second detail image under a single color channel, can be used as the first structural similarity of the single color channel. And the first structural similarity of the first detail image and the second detail image in each color channel is used as the detail similarity of the image to be identified and the reference image in each color channel.

[0114] It should be noted that in some embodiments of the present application, Figures 2 to 5 The method shown calculates the first structural similarity of the first detail image and the second detail image corresponding to each color channel in sequence.

[0115] In the implementation of the present application, based on performing multiple different Gaussian filtering processes on the image to be identified, a first detail image with detail information of different scales can be obtained, and based on performing multiple different Gaussian filtering processes on the reference image, a second detail image with detail information of different scales can also be obtained, and then the first structural similarity of the first detail image and the second detail image in each color channel is used as the detail similarity of the image to be identified and the reference image in each color channel, so that the detail similarity can characterize the similarity between the detail information of the image to be identified and the reference image at multiple different scales. Based on the detail similarity, the instrument state can be identified for instruments with only differences in details between different instrument states, thereby improving the accuracy and universality of the instrument state identification of the present application.

[0116] Furthermore, the present application calculates the regional similarity between the first image area of ​​the first detail image and the second image area of ​​the second detail image based on the brightness comparison value, the contrast comparison value and the structure comparison value, so that the above-mentioned detail similarity also represents the similarity in color, contrast and structure under details of different scales, thereby further improving the accuracy and universality of instrument status recognition.

[0117] In other embodiments of the present application, Figure 6 As shown, the determination of the low-frequency similarity may include the following steps S601 to S603.

[0118] Step S601 , down-sample the image to be recognized to obtain a down-sampled first image, and then up-sample the first image according to the size of the image to be recognized to obtain an up-sampled second image.

[0119] Specifically, in some embodiments of the present application, the image to be identified can be downsampled by random downsampling, convolution downsampling, etc. to obtain a first image. Then, the first image is upsampled according to the size of the image to be identified, that is, upsampled by a multiple corresponding to the downsampling to obtain a second image, so that the second image and the image to be identified have the same size but different image content, that is, the second image contains the downsampled image information, that is, contains the low-frequency information of the image to be identified.

[0120] Step S602: down-sample the reference image to obtain a down-sampled third image, and then up-sample the third image according to the size of the reference image to obtain an up-sampled fourth image.

[0121] The size of the reference image is the same as the size of the image to be identified.

[0122] Similarly, in some embodiments of the present application, the reference image may be downsampled by random downsampling, convolution downsampling, etc. to obtain a third image. The third image is then upsampled according to the size of the reference image, that is, upsampled by a multiple corresponding to the downsampling to obtain a fourth image, so that the fourth image and the reference image have the same size but different image contents, that is, the fourth image contains the downsampled image information, that is, contains the low-frequency information of the reference image.

[0123] Step S603, calculating the second structural similarity between the second image and the fourth image in each color channel, and using the second structural similarity between the second image and the fourth image in each color channel as the low-frequency similarity between the image to be identified and the reference image in each color channel.

[0124] Specifically, the calculation method of the second structural similarity can refer to the calculation method of the first structural similarity, which will not be elaborated in this application.

[0125] Likewise, in some implementations of the present application, the second structural similarity of the second image and the fourth detail image corresponding to each color channel may be calculated in sequence.

[0126] In the implementation of the present application, based on downsampling the image to be identified and then upsampling it, a second image fused with the low-frequency information of the image to be identified can be obtained, and based on downsampling the reference image and then upsampling it, a fourth image fused with the low-frequency information of the reference image can also be obtained, and then the second structural similarity of the second image and the fourth image in each color channel is used as the low-frequency similarity of the image to be identified and the reference image in each color channel, so that the low-frequency similarity can characterize the similarity between the low-frequency information of the image to be identified and the reference image. Based on the low-frequency similarity, the instrument state can be identified for instruments with different instrument states that differ only in low-frequency details, thereby improving the accuracy and universality of the instrument state identification of the present application.

[0127] In some other embodiments of the present application, the above-mentioned terminal can also calculate the third structural similarity between the image to be identified and the reference image in each color channel, and use the third structural similarity between the image to be identified and the reference image in each color channel as the original image similarity between the image to be identified and the reference image in each color channel.

[0128] The specific calculation method of the third structural similarity can refer to the calculation method of the first structural similarity mentioned above, and this application will not elaborate on it here.

[0129] After determining the original image similarity, the low-frequency similarity and the detail similarity, the terminal may further determine the state of the instrument in the image to be identified.

[0130] Specifically, when the instrument is a two-state instrument, such as Figure 7 As shown, the above-mentioned determination of the instrument status may include the following steps S701 to S702.

[0131] Step S701 , calculating the image similarity between the image to be identified and the reference image in each color channel according to the original image similarity, low frequency similarity and detail similarity between the image to be identified and the reference image in each color channel.

[0132] Since the image to be identified, the reference image, and the Figures 2 to 5 The first detail image and the second detail image obtained by the method shown in the figure are based on the above Figure 6 In the manner shown, the second image and the fourth image are both images of the same size, and therefore, the image similarity can be calculated by weighted fusion.

[0133] Specifically, in some embodiments of the present application, for a single color channel, weighted fusion may be performed based on the original image similarity, low-frequency similarity, and detail similarity in the color channel to obtain the image similarity in the color channel.

[0134] Assuming that the original image similarity of the B channel is ssim_org[0], the low-frequency similarity ssim_resize[0] is, and the detail similarity is ssim_msdb[0], then the image similarity under the B channel ssim_b = ssim_org[0] × θ 1 +ssim_resize[0]×θ 2 +ssim_msdb[0]×θ 3 .

[0135] Among them, θ 1 ,θ 2 and θ 3 Respectively represent the weights of the original image similarity, low-frequency similarity and detail similarity. In some embodiments of the present application, θ 1 can be set to 0.3, θ 2 can be set to 0.3, θ 3 Can be set to 0.4.

[0136] Similarly, assuming that the original image similarity of the G channel is ssim_org[1], the low-frequency similarity is ssim_resize[1], and the detail similarity is ssim_msdb[1], then the image similarity under the G channel is ssim_g = ssim_org[1] × θ 1 +ssim_resize[1]×θ 2 +ssim_msdb[1]×θ 3 .

[0137] Similarly, assuming that the original image similarity of the R channel is ssim_org[2], the low-frequency similarity is ssim_resize[2], and the detail similarity is ssim_msdb[2], then the image similarity under the R channel can be ssim_r = ssim_org[2] × θ 1 +ssim_resize[2]×θ 2 +ssim_msdb[2]×θ 3 .

[0138] Step S702: If the image similarity between the image to be identified and the reference image in any color channel is greater than or equal to a second similarity threshold, the instrument state of the instrument is determined as the reference instrument state corresponding to the reference image.

[0139] The second similarity threshold refers to the lowest value of the image similarity corresponding to the color channel having the highest image similarity between the image to be identified and the reference image when the image to be identified and the reference image are similar images.

[0140] That is, when the image similarity between the image to be identified and the reference image in a certain color channel is greater than or equal to the second similarity threshold, the image to be identified and the reference image are considered to be similar in the color channel, and therefore the image to be identified and the reference image are also considered to be similar.

[0141] It should be noted that since the above-mentioned detail enhancement processing, Gaussian filtering processing and other image processing processes may cause changes in image pixel values, the present application considers that the image to be identified and the reference image are similar when the image similarity between the image to be identified and the reference image in any color channel is greater than or equal to the second similarity threshold.

[0142] If the image to be identified and the reference image are similar, the instrument state of the instrument in the image to be identified should also be consistent with the reference instrument state of the instrument in the reference image. Therefore, the above-mentioned terminal can determine the instrument state of the instrument as the reference instrument state corresponding to the reference image when the image similarity under any color channel is greater than or equal to the second similarity threshold.

[0143] Correspondingly, if the image similarity between the image to be identified and the reference image in each color channel is less than the second similarity threshold, the instrument state of the instrument is determined to be an instrument state different from the instrument state corresponding to the reference image.

[0144] In an implementation manner of the present application, the image similarity between the image to be identified and the reference image in each color channel is calculated based on the original image similarity, low-frequency similarity and detail similarity in each color channel, and when the image similarity between the identified image and the reference image in any color channel is greater than or equal to a second similarity threshold, the instrument state of the instrument is determined as the reference instrument state corresponding to the reference image. While realizing the state recognition of the two-state meter, based on the fusion of the original image similarity, the low-frequency similarity and the detail similarity, the instrument state of the instrument that uses different colors, characters, symbols and other information to represent different instrument states can be identified.

[0145] Figures 8 to 10 A schematic diagram showing the effect of using the solution provided by the present application to identify different instruments.

[0146] like Figure 8 As shown, by performing detail enhancement processing on the image to be identified 801, a first detail image 803 can be obtained; by performing detail enhancement processing on the reference image 802, a second detail image 804 can be obtained; by downsampling the image to be identified 801 and then upsampling it, a second image 805 can be obtained; by downsampling the reference image 802 and then upsampling it, a fourth image 806 can be obtained; based on the image to be identified 801 and the reference image 802, the original image similarity in each color channel can be calculated; based on the first detail image 803 and the second detail image 804, the detail similarity in each color channel can be calculated; based on the second image 805 and the fourth image 806, the low-frequency similarity in each color channel can be calculated; and then the image similarity between the image to be identified 801 and the reference image 802 in each color channel can be calculated. Since the image similarity between the image to be identified 801 and the reference image 802 in any color channel is less than the second similarity threshold, as shown in image 807, a result that the image to be identified 801 and the reference image 802 are dissimilar (where "1.0dissimilar" indicates dissimilarity) can be obtained. Based on this, according to the reference instrument status "OK" corresponding to the reference image 802, it can be determined that the instrument status of the instrument in the image to be identified 801 is "OK".

[0147] like Fig. 9As shown, by performing detail enhancement processing on the image to be identified 901, a first detail image 903 can be obtained; by performing detail enhancement processing on the reference image 902, a second detail image 904 can be obtained; by downsampling the image to be identified 901 and then upsampling it, a second image 905 can be obtained; by downsampling the reference image 902 and then upsampling it, a fourth image 906 can be obtained; based on the image to be identified 901 and the reference image 902, the original image similarity under each color channel can be calculated; based on the first detail image 903 and the second detail image 904, the detail similarity under each color channel can be calculated; based on the second image 905 and the fourth image 906, the low-frequency similarity under each color channel can be calculated; and then the image similarity under each color channel between the image to be identified 901 and the reference image 902 is calculated. Since the image similarity under any color channel between the image to be identified 901 and the reference image 902 is less than the second similarity threshold, as shown in image 907, the result that the image to be identified 901 and the reference image 902 are not similar is obtained. Based on this, according to the reference instrument state “ON” corresponding to the reference image 902 , it can be determined that the instrument state of the instrument in the to-be-recognized image 901 is “OFF”.

[0148] like Fig.10 As shown, by performing detail enhancement processing on the image to be identified 1001, a first detail image 1003 can be obtained; by performing detail enhancement processing on the reference image 1002, a second detail image 1004 can be obtained; by downsampling the image to be identified 1001 and then upsampling it, a second image 1005 can be obtained; by downsampling the reference image 1002 and then upsampling it, a fourth image 1006 can be obtained; based on the image to be identified 1001 and the reference image 1002, the original image similarity in each color channel can be calculated; based on the first detail image 1003 and the second detail image 1004, the detail similarity in each color channel can be calculated; based on the second image 1005 and the fourth image 1006, the low-frequency similarity in each color channel can be calculated; and then the image similarity between the image to be identified 1001 and the reference image 1002 in each color channel can be calculated. Since the image similarity between the image to be identified 1001 and the reference image 1002 in any color channel is less than the second similarity threshold, as shown in image 1007, the result that the image to be identified 1001 and the reference image 1002 are not similar is obtained. Based on this, according to the reference instrument state "CLOSE" corresponding to the reference image 1002, it can be determined that the instrument state of the instrument in the image to be identified 1001 is "OPEN".

[0149] By performing detail enhancement processing on the reference image 1008, a second detail image 1009 can be obtained. By performing downsampling and then upsampling on the reference image 1008, a fourth image 1010 can be obtained. Based on the image to be identified 1001 and the reference image 1008, the original image similarity under each color channel can be calculated. Based on the first detail image 1003 and the second detail image 1009, the detail similarity under each color channel can be calculated. Based on the second image 1005 and the fourth image 1010, the low-frequency similarity under each color channel can be calculated. Then, the image similarity under each color channel of the image to be identified 1001 and the reference image 1008 is calculated. Since the image similarity under any color channel of the image to be identified 1001 and the reference image 1008 is greater than or equal to the second similarity threshold, as shown in image 1011, the result that the image to be identified 1001 and the reference image 1008 are similar is obtained (where "0.0similar" indicates similarity). Based on this, according to the reference instrument state “OPEN” corresponding to the reference image 1008 , it can be determined that the instrument state of the instrument in the to-be-recognized image 1001 is “OPEN”.

[0150] based on Figures 8 to 10 It can be seen that the solution provided by this application has good universality and can obtain accurate recognition results for different instruments. At the same time, in the laboratory environment, the solution provided by this application also has higher real-time performance than the existing technology.

[0151] It should be noted that the present application can also be used for meters with multiple instrument states.

[0152] In some embodiments of the present application, the terminal may pre-group reference images corresponding to multiple instrument states of multi-meter state type meters into the same group, and calculate image similarities between the image to be identified and the multiple reference images in the group in turn, thereby identifying the instrument state of the instrument in the image to be identified.

[0153] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders.

[0154] like Fig.11 FIG. 1 is a schematic diagram of the structure of a device 1100 for determining a meter status provided in an embodiment of the present application. The device 1100 for determining a meter status is configured on a terminal.

[0155] Specifically, the device 1100 for determining the meter status may include:

[0156] The to-be-recognized image acquisition unit 1101 is used to acquire the to-be-recognized image obtained by photographing the instrument;

[0157] A reference image acquisition unit 1102, configured to acquire a reference image;

[0158] A similarity determination unit 1103 is used to determine the original image similarity, low frequency similarity and detail similarity of the image to be identified and the reference image in each color channel;

[0159] The instrument state determining unit 1104 is used to determine the instrument state of the instrument based on the original image similarity, the low frequency similarity, the detail similarity and the reference instrument state corresponding to the reference image between the image to be identified and the reference image in each color channel.

[0160] In some embodiments of the present application, the above-mentioned similarity determination unit 1103 can also be specifically used to: perform detail enhancement processing on the image to be identified to obtain a first detail image of the image to be identified; perform detail enhancement processing on the reference image to obtain a second detail image of the reference image; calculate the first structural similarity between the first detail image and the second detail image in each color channel, and use the first structural similarity between the first detail image and the second detail image in each color channel as the detail similarity between the image to be identified and the reference image in each color channel.

[0161] In some embodiments of the present application, the similarity determination unit 1103 may also be specifically used to: perform Gaussian filtering on the image to be identified for a preset number of times to obtain multiple Gaussian filtered images of the image to be identified; wherein the convolution kernel size and variance value corresponding to each Gaussian filtering process are increased in sequence; based on the image to be identified and the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified, extract the first detail image to be fused, and based on the Gaussian filtered image obtained by performing the first Gaussian filtering process on the image to be identified and the Gaussian filtered image obtained by performing the second Gaussian filtering process on the image to be identified, extract the second detail image to be fused, and so on, to obtain a first number of detail images to be fused, the first number being equal to the numerical value of the preset number of times; weighted fusion is performed on the first number of detail images to be fused to obtain a first detail image of the image to be identified.

[0162] In some embodiments of the present application, for a single color channel, the similarity determination unit 1103 may also be specifically used to: obtain a first image region obtained by each sliding of the sliding window on the first detail image, and a second image region obtained by each sliding of the sliding window on the second detail image; calculate the regional similarity between each first image region and the second image region corresponding thereto according to the first pixel value of each pixel in the first image region under the single color channel, and the second pixel value of each pixel in the second image region corresponding to the first image region under the single color channel; determine a first total number of target image regions, wherein the target image region is the first image region whose regional similarity is greater than or equal to a first similarity threshold, or the target image region is the second image region whose regional similarity is greater than or equal to the first similarity threshold; and use the ratio of the first total number to the second total number as the first structural similarity of the single color channel, wherein the second total number is the total number of the first image regions, or is the total number of the second image regions.

[0163] In some embodiments of the present application, the above-mentioned similarity determination unit 1103 can also be specifically used to: determine the first pixel value mean of the first image area in the single color channel and the first pixel value standard deviation of the first image area in the single color channel according to the first pixel value of each pixel point in the first image area in the single color channel; determine the second pixel value mean of the second image area in the single color channel and the second pixel value standard deviation of the second image area in the single color channel according to the second pixel value of each pixel point in the second image area in the single color channel; calculate the first image area and its corresponding image according to the first pixel value mean and the second pixel value mean. the pixel value covariance between the first image region and the second image region corresponding thereto; calculating the brightness comparison value between the first image region and the second image region corresponding thereto according to the first pixel value mean and the second pixel value mean; calculating the contrast comparison value between the first image region and the second image region corresponding thereto according to the first pixel value standard deviation and the second pixel value standard deviation; calculating the structure comparison value between the first image region and the second image region corresponding thereto according to the first pixel value standard deviation, the second pixel value standard deviation and the pixel value covariance; calculating the regional similarity between the first image region and the second image region according to the brightness comparison value, the contrast comparison value and the structure comparison value.

[0164] In some embodiments of the present application, the above-mentioned similarity determination unit 1103 can also be specifically used to: downsample the image to be identified to obtain a downsampled first image, and then upsample the first image according to the size of the image to be identified to obtain an upsampled second image; downsample the reference image to obtain a downsampled third image, and then upsample the third image according to the size of the reference image to obtain an upsampled fourth image; wherein the size of the reference image is the same as the size of the image to be identified; calculate the second structural similarity between the second image and the fourth image in each color channel, and use the second structural similarity between the second image and the fourth image in each color channel as the low-frequency similarity between the image to be identified and the reference image in each color channel.

[0165] In some embodiments of the present application, the above-mentioned instrument is a two-state instrument; the above-mentioned instrument state determination unit 1104 can also be specifically used to: calculate the image similarity between the image to be identified and the reference image in each color channel according to the original image similarity, low-frequency similarity and detail similarity between the image to be identified and the reference image in each color channel; if the image similarity between the image to be identified and the reference image in any color channel is greater than or equal to the second similarity threshold, the instrument state of the instrument is determined as the reference instrument state corresponding to the reference image.

[0166] It should be noted that, for the convenience and simplicity of description, the specific working process of the above-mentioned instrument status determination device 1100 can refer to Figures 1 to 10 The corresponding process of the method will not be repeated here.

[0167] like Fig.12 The terminal 12 may include: a processor 120, a memory 121, and a computer program 122 stored in the memory 121 and executable on the processor 120, such as a program for determining the status of an instrument. When the processor 120 executes the computer program 122, the steps in the above-mentioned method for determining the status of an instrument are implemented, such as Figure 1 Alternatively, when the processor 120 executes the computer program 122, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.11 The illustrated unit includes an image-to-be-recognized acquiring unit 1101 , a reference image acquiring unit 1102 , a similarity determining unit 1103 , and an instrument state determining unit 1104 .

[0168] The computer program may be divided into one or more modules / units, which are stored in the memory 121 and executed by the processor 120 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal.

[0169] For example, the computer program may be divided into: a to-be-recognized image acquisition unit, a reference image acquisition unit, a similarity determination unit, and an instrument state determination unit.

[0170] The specific functions of each unit are as follows: an image acquisition unit for obtaining a to-be-identified image obtained by photographing the instrument; a reference image acquisition unit for obtaining a reference image; a similarity determination unit for determining the original image similarity, low-frequency similarity and detail similarity between the image to be identified and the reference image in each color channel; an instrument state determination unit for determining the instrument state of the instrument based on the original image similarity, low-frequency similarity, detail similarity between the image to be identified and the reference image in each color channel and the reference instrument state corresponding to the reference image.

[0171] The terminal may include, but is not limited to, a processor 120 and a memory 121. Those skilled in the art will appreciate that Fig.12 It is only an example of a terminal and does not constitute a limitation on the terminal. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.

[0172] The processor 120 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0173] The memory 121 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. The memory 121 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 121 may also include both an internal storage unit of the terminal and an external storage device. The memory 121 is used to store the computer program and other programs and data required by the terminal. The memory 121 may also be used to temporarily store data that has been output or is to be output.

[0174] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0176] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0177] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0180] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0181] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for determining an instrument status, characterized in that: include: Acquire an image to be identified by photographing the instrument; Get a reference image; Determine the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel; Determine the instrument state of the instrument based on the original image similarity, the low-frequency similarity, the detail similarity and the reference instrument state corresponding to the reference image between the image to be identified and the reference image in each color channel; The determination of the detail similarity includes: performing detail enhancement processing on the image to be identified to obtain a first detail image of the image to be identified; performing detail enhancement processing on the reference image to obtain a second detail image of the reference image; calculating a first structural similarity between the first detail image and the second detail image in each color channel, and using the first structural similarity between the first detail image and the second detail image in each color channel as the detail similarity between the image to be identified and the reference image in each color channel; wherein, in the step of calculating the first structural similarity between the first detail image and the second detail image in each color channel, the step of calculating the structural similarity in a single color channel includes: obtaining a first image area obtained by each sliding of the sliding window on the first detail image, and obtaining a first image area obtained by each sliding of the sliding window on the second detail image. a second image area obtained by sliding; calculating the regional similarity between each first image area and the second image area corresponding thereto according to the first pixel value of each pixel point in the first image area under the single color channel and the second pixel value of each pixel point in the second image area corresponding to the first image area under the single color channel; determining a first total number of target image areas, the target image area being the first image area whose regional similarity is greater than or equal to a first similarity threshold, or the target image area being the second image area whose regional similarity is greater than or equal to the first similarity threshold; taking the ratio of the first total number to the second total number as the first structural similarity of the single color channel, wherein the second total number is the total number of the first image areas, or the total number of the second image areas; The determination of the low-frequency similarity includes: down-sampling the image to be identified to obtain a down-sampled first image, and then up-sampling the first image according to the size of the image to be identified to obtain an up-sampled second image; down-sampling the reference image to obtain a down-sampled third image, and then up-sampling the third image according to the size of the reference image to obtain an up-sampled fourth image; wherein the size of the reference image is the same as the size of the image to be identified; calculating the second structural similarity between the second image and the fourth image in each color channel, and using the second structural similarity between the second image and the fourth image in each color channel as the low-frequency similarity between the image to be identified and the reference image in each color channel.

2. The method for determining the instrument status according to claim 1, characterized in that: The performing detail enhancement processing on the image to be identified to obtain a first detail image of the image to be identified includes: Performing Gaussian filtering on the image to be identified for a preset number of times to obtain multiple Gaussian filtered images of the image to be identified; wherein the convolution kernel size and variance value corresponding to each Gaussian filtering process are increased in sequence; Based on the image to be identified and the Gaussian filtered image obtained by performing a first Gaussian filtering process on the image to be identified, extracting a first detail image to be fused, and based on the Gaussian filtered image obtained by performing a first Gaussian filtering process on the image to be identified and the Gaussian filtered image obtained by performing a second Gaussian filtering process on the image to be identified, extracting a second detail image to be fused, and so on, to obtain a first number of detail images to be fused, wherein the first number is equal to the value of the preset number; The first number of detail images to be fused are weightedly fused to obtain a first detail image of the image to be recognized.

3. The method for determining the instrument status according to claim 1, characterized in that: The calculating, according to the first pixel value of each pixel point in the first image area under the single color channel and the second pixel value of each pixel point in the second image area corresponding to the first image area under the single color channel, the regional similarity between each first image area and the second image area corresponding thereto, comprises: Determine, according to the first pixel value of each pixel point in the first image area in the single color channel, a first pixel value mean of the first image area in the single color channel and a first pixel value standard deviation of the first image area in the single color channel; Determine, according to the second pixel value of each pixel point in the second image area in the single color channel, a mean value of the second pixel values ​​of the second image area in the single color channel and a standard deviation of the second pixel values ​​of the second image area in the single color channel; Calculating a pixel value covariance between the first image region and the second image region corresponding thereto according to the first pixel value mean and the second pixel value mean; Calculating a brightness comparison value between the first image area and the second image area corresponding thereto according to the first pixel value mean and the second pixel value mean; Calculating a contrast comparison value between the first image area and the second image area corresponding thereto according to the first pixel value standard deviation and the second pixel value standard deviation; Calculating a structural comparison value between the first image region and the second image region corresponding thereto according to the first pixel value standard deviation, the second pixel value standard deviation, and the pixel value covariance; The region similarity between the first image region and the second image region is calculated according to the brightness comparison value, the contrast comparison value and the structure comparison value.

4. The method for determining the instrument status according to any one of claims 1 to 3, characterized in that: The instrument is a two-state instrument; The determining the instrument state of the instrument based on the original image similarity, the low-frequency similarity, the detail similarity and the reference instrument state corresponding to the reference image in each color channel of the image to be identified and the reference image includes: Calculate the image similarity between the image to be identified and the reference image in each color channel according to the original image similarity, low-frequency similarity and detail similarity between the image to be identified and the reference image in each color channel; If the image similarity between the image to be identified and the reference image in any color channel is greater than or equal to a second similarity threshold, the instrument state of the instrument is determined as the reference instrument state corresponding to the reference image.

5. A device for determining an instrument state, characterized in that: include: The image acquisition unit to be identified is used to acquire the image to be identified obtained by photographing the instrument; A reference image acquisition unit, used for acquiring a reference image; A similarity determination unit, used to determine the original image similarity, low-frequency similarity and detail similarity of the image to be identified and the reference image in each color channel; an instrument state determining unit, configured to determine the instrument state of the instrument based on the original image similarity, the low frequency similarity, the detail similarity and the reference instrument state corresponding to the reference image between the image to be identified and the reference image in each color channel; The similarity determination unit is used to perform detail enhancement processing on the image to be identified to obtain a first detail image of the image to be identified; The reference image is subjected to detail enhancement processing to obtain a second detail image of the reference image; a first structural similarity between the first detail image and the second detail image in each color channel is calculated, and the first structural similarity between the first detail image and the second detail image in each color channel is used as the detail similarity between the image to be identified and the reference image in each color channel; wherein, in the step of calculating the first structural similarity between the first detail image and the second detail image in each color channel, the step of calculating the structural similarity in a single color channel includes: obtaining a first image area obtained by each sliding of the sliding window on the first detail image, and a second image area obtained by each sliding of the sliding window on the second detail image; according to each sliding of the first image area The method comprises: calculating the first pixel value of each pixel point in the single color channel and the second pixel value of each pixel point in the second image area corresponding to the first image area under the single color channel, and obtaining the regional similarity between each first image area and the second image area corresponding thereto; determining a first total number of target image areas, wherein the target image area is the first image area whose regional similarity is greater than or equal to a first similarity threshold, or the target image area is the second image area whose regional similarity is greater than or equal to the first similarity threshold; taking the ratio of the first total number to the second total number as the first structural similarity of the single color channel, wherein the second total number is the total number of the first image areas, or the total number of the second image areas; The similarity determination unit is used to downsample the image to be identified to obtain a downsampled first image, and then upsample the first image according to the size of the image to be identified to obtain an upsampled second image; downsample the reference image to obtain a downsampled third image, and then upsample the third image according to the size of the reference image to obtain an upsampled fourth image; wherein the size of the reference image is the same as the size of the image to be identified; calculate the second structural similarity between the second image and the fourth image in each color channel, and use the second structural similarity between the second image and the fourth image in each color channel as the low-frequency similarity between the image to be identified and the reference image in each color channel.

6. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.