Method, device, computer equipment and readable storage medium for determining platen status
By collecting and processing the image of the substation voltage plate, generating mask images and detecting edge lines, the problem of relying on manual inspection in the prior art is solved, and more efficient and accurate pressure plate status detection is achieved.
Patent Information
- Application Number
- CN202110869414.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-07-30
AI Technical Summary
In the prior art, monitoring of the voltage plate status of substations mainly relies on manual inspection, which has problems such as time-consuming, error-prone, difficulty in data informatization and high labor costs, resulting in the determination of the pressure plate status is not intelligent enough.
By collecting the original image of the press plate, a mask image is generated, and the edge lines of each single press plate in the original image of the press plate are determined based on the mask image, thereby determining its state. The method includes communication domain extraction, edge line detection and state determination, and using preset thresholds to determine the closed, semi-closed and open states of the press plate.
It improves the intelligence level of pressure plate status detection, reduces manual intervention, improves the accuracy and efficiency of detection, and reduces labor costs.
Smart Images

Figure CN113744188B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology (image processing technology), and in particular to a method and device for determining a platen state, a computer device, and a readable storage medium. Background Art
[0002] The secondary pressure plate is an important component in the secondary power panel cabinet of the substation. It plays an important role in the safety of the substation and the operation of the equipment in the substation. Accurately recording the status of the pressure plate is of vital importance to the safe operation of the substation.
[0003] In the traditional way, the status of the pressure plate is mainly monitored by substation operation and maintenance personnel who conduct regular inspections and record their status.
[0004] However, there are many disadvantages in detecting the status of the pressure plates through manual inspections, such as the large number of pressure plates, long inspection times, easy errors in manual transcription, difficulty in data informatization, and high labor costs, which makes the process of determining the status of the pressure plates not intelligent enough. Summary of the invention
[0005] Based on this, it is necessary to provide a pressure plate status determination method, device, computer equipment and storage medium that can improve the intelligence level of substation pressure plate status determination in response to the above technical problems.
[0006] A method for determining a platen state, comprising:
[0007] Collecting an original image of a pressing plate, wherein the original image of the pressing plate includes at least one single pressing plate;
[0008] Based on the original image of the pressure plate, a corresponding mask image is generated;
[0009] According to the mask image, the edge straight line of each single pressing plate in the original pressing plate image is determined;
[0010] Based on each edge straight line, the pressing plate state of each individual pressing plate in the pressing plate original image is determined.
[0011] In one embodiment, determining the edge straight line of the single platen according to the mask image includes:
[0012] Perform connected domain extraction on the mask image to determine the monomer mask image corresponding to each monomer pressure plate;
[0013] The edge straight line detection is performed on each monomer mask image to determine the edge straight line of each monomer pressure plate.
[0014] In one embodiment, connected domain extraction is performed on the mask image to determine the monomer mask image corresponding to each monomer pressing plate, including:
[0015] Obtain the pixel value and coordinate position of each pixel in the mask image;
[0016] Determine connected pixel points in the mask image according to each pixel value and each coordinate position;
[0017] Based on the connected pixel points, the connected domain is determined to obtain the monomer mask image corresponding to each monomer pressure plate.
[0018] In one embodiment, determining the edge straight line of each single pressure plate includes:
[0019] Perform edge extraction on the monomer mask image of each monomer pressing plate to obtain edge information of each monomer pressing plate;
[0020] Based on each edge information, determine the edge profile of each single platen;
[0021] Segment each edge contour to generate corresponding contour line segments;
[0022] The contour segments are clustered to obtain the edge straight lines corresponding to each monomer pressure plate.
[0023] In one embodiment, edge extraction is performed on the monomer mask image of each monomer pressing plate to obtain edge information of each monomer pressing plate, including:
[0024] According to the monomer mask image, determine the mask pixel value and coordinate position of each pixel point in the monomer mask image;
[0025] Based on each mask pixel value, determine the target pixel point of the corresponding single platen;
[0026] According to the coordinate position of the target pixel point, the edge information of the single pressure plate is obtained.
[0027] In one embodiment, determining the pressing plate state of each individual pressing plate in the pressing plate original image based on each edge straight line includes:
[0028] According to the edge straight lines of each single pressing plate, the included angle of the edge straight lines of each single pressing plate is determined;
[0029] When the included angle of the edge straight line is less than a first preset threshold, determining that the pressing plate state of the single pressing plate is a closed state;
[0030] When the included angle of the edge straight lines is greater than or equal to a first preset threshold and less than a second preset threshold, determining that the pressing plate state of the single pressing plate is a semi-closed state;
[0031] When the edge straight line angle is greater than or equal to the second preset threshold, it is determined that the pressing plate state of the single pressing plate is the open state.
[0032] In one embodiment, the corresponding mask image is generated by a pre-trained mask generation model, and the training method of the mask generation model includes:
[0033] Acquire a training image set, the training image set including a plurality of training images, each training image including at least one single pressing plate;
[0034] Annotate the pressure plate in each training image, annotate the contour area and label of the pressure plate, and obtain an annotated training image set;
[0035] The labeled training image set is input into the pre-built initial mask generation model, and the initial mask generation model is used to segment the pressure plate in each training image according to the labeled labels to generate the corresponding output mask image;
[0036] Determining a model loss of an initial mask generation model based on the output mask image and the training image set;
[0037] According to the model loss, the initial mask generation model is iteratively trained to obtain a trained mask model.
[0038] A device for determining a pressing plate state, comprising:
[0039] An image acquisition module is used to acquire an original image of a pressing plate, wherein the original image of the pressing plate includes at least one single pressing plate;
[0040] The mask generation module generates a corresponding mask image based on the original image of the pressure plate;
[0041] The mask image analysis module determines the edge straight lines of each single pressing plate in the original pressing plate image according to the mask image;
[0042] The pressure plate state analysis module determines the pressure plate state of each individual pressure plate in the pressure plate original image based on each edge straight line.
[0043] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.
[0044] A computer-readable storage medium stores a computer program, which implements the steps of the method described in any of the above embodiments when the computer program is executed by a processor.
[0045] The above-mentioned platen state determination method, device, computer equipment and readable storage medium collect the original image of the platen, which includes at least one single platen, and then generate a corresponding mask image based on the original image of the platen, and determine the edge straight lines of each single platen in the original image of the platen based on the mask image, and further determine the platen state of each single platen in the original image of the platen based on each edge straight line. Therefore, compared with manual detection of the platen state, the intelligent level of platen state detection is improved. In addition, by generating a mask image based on the original image and then identifying the edge line, the subsequent edge line identification is based on the mask image, which can improve the accuracy of edge line identification, and then improve the accuracy of subsequent platen state analysis and determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of a process for determining a platen state;
[0047] Figure 2 It is a schematic flow chart of a method for determining a pressing plate state in one embodiment;
[0048] Figure 3 A schematic diagram of a step of determining a state of a pressing plate according to a mask image in one embodiment;
[0049] Figure 4 A schematic diagram of the decomposition of steps for generating a mask image by a server in another embodiment;
[0050] Figure 5 is a structural block diagram of a device for determining a pressing plate state in one embodiment;
[0051] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution 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 used to limit the present application.
[0053] The platen state determination method, device, computer equipment and readable storage medium provided in the present application can be applied to the analysis of the platen state of a substation. Among them, the terminal 102 communicates with the server 104 through a network. The server 104 provides an environment for implementing the platen state determination method to the terminal, and the terminal installs this environment, and the determination and display of the platen state are realized through this environment. Specifically, the server 104 can obtain the original image of the platen and generate a corresponding mask image. Further, the server 104 processes the mask image to obtain each monomer platen image on the original image of the platen, and determines the edge straight line of each monomer platen in each monomer platen image. Further, based on each edge straight line, the server 104 can determine the platen state of each monomer platen in the original image of the platen. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.
[0054] In one embodiment, Figure 2 As shown, a method for determining the state of a pressure plate is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0055] Step 202: Acquire an original image of a press plate, wherein the original image of the press plate includes at least one single press plate.
[0056] The original image of the press plate refers to an image containing a single press plate. The original image of the press plate can be as follows: Figure 3 As shown in (a), the single platen is Figure 3 As shown in 1, 2, 3, and 4 in (a).
[0057] In this embodiment, the server may use an image acquisition device to acquire the original platen image including the single platen. For example, the source of the original platen image may include but is not limited to image acquisition devices such as robots and video system cameras.
[0058] Step 204: Generate a corresponding mask image based on the original image of the pressing plate.
[0059] The mask image refers to an image that only includes the contour state of the platen, which can be Figure 3 As shown in (b), the black-filled part of the mask image is the non-pressing plate area, and the white-filled area is the pressing plate area.
[0060] In this embodiment, after acquiring the original image of the pressing plate, the server may perform mask conversion on the original image of the pressing plate to generate a corresponding mask image.
[0061] Specifically, the server may identify the individual pressing plates in the original pressing plate image through a neural network model or other image recognition methods, and convert the individual pressing plates to generate a corresponding mask image.
[0062] Step 206: Determine the edge straight line of each single pressing plate in the original pressing plate image according to the mask image.
[0063] The edge line refers to the edge line of the single platen in the mask image. Figure 3 (b) refers specifically to the long side straight line of the pressure plate.
[0064] In this embodiment, the server identifies each monomer pressure plate in the mask image according to the mask image, and then extracts the edge straight line of each monomer.
[0065] In this embodiment, for each single pressure plate, the server can extract multiple edge lines, and then perform subsequent state recognition processing on each single pressure plate based on the multiple edge lines.
[0066] Step 208: determining the pressing plate state of each individual pressing plate in the pressing plate original image based on each edge straight line.
[0067] The pressing plate state of each individual pressing plate in the pressing plate original image may include but is not limited to an open state, a semi-closed state, a closed state, and the like.
[0068] In this embodiment, the open state refers to a fixed angle between the two pressing plates constituting the pressing plate, showing an open filling state, such as Figure 3 (a) 1 and 3. The semi-closed state refers to the state where the angle between the two pressing plates constituting the pressing plate is small and has not reached the open state, such as Figure 3 (a) 4. In the closed state, the two pressing plates constituting the pressing plate are in an overlapping relationship, as shown in FIG. Figure 3 As shown in 2 in (a).
[0069] In this embodiment, after the server determines the edge straight lines of each individual pressure plate through edge line detection, it can determine the edge straight line angles of each individual pressure plate based on the edge straight lines, and based on the edge straight line angles of each individual pressure plate, determine the pressure plate state of each individual pressure plate in the pressure plate original image, that is, determine whether it is in an open state, a semi-closed state, or a closed state.
[0070] The above-mentioned platen state determination method collects the original platen image, which includes at least one single platen, and then generates a corresponding mask image based on the original platen image, and determines the edge straight lines of each single platen in the original platen image according to the mask image, and further determines the platen state of each single platen in the original platen image based on each edge straight line. Therefore, compared with manual detection of the platen state, the intelligent level of platen state detection is improved. In addition, by generating a mask image based on the original image and then identifying the edge line, the subsequent edge line identification is based on the mask image, which can improve the accuracy of edge line identification, and further improve the accuracy of subsequent platen state analysis and determination.
[0071] In one embodiment, determining the edge straight lines of the monomer pressure plates according to the mask image may include: performing connected domain extraction on the mask image to determine the monomer mask images corresponding to each monomer pressure plate; performing edge straight line detection on each monomer mask image to determine the edge straight lines of each monomer pressure plate.
[0072] The connected domain refers to the area in the image that has the same pixels and is connected.
[0073] In this embodiment, after acquiring the mask image, the server can determine whether two pixels on the mask image are connected by judging the pixel values of the connected pixels on the mask image. For example, if pixel A and pixel B are adjacent in the mask image, and the pixel values of pixel A and pixel B are equal, it can be determined that pixel A is connected to pixel B, otherwise it is determined that pixel A and pixel B are not connected.
[0074] In this embodiment, the server extracts the connected domain of the mask image to determine whether the pixels on the mask image are connected. If two pixels on the mask image are connected, the two pixels are in a connected domain, that is, the two pixels are on the same single mask image of the single platen or in the mask image of the non-single platen. Figure 3 (b) is the white area or the black area. If two pixels on the mask image are not connected, then the two pixels are in two different connected domains, that is, the two pixels may be on the single mask images of two single pressure plates, or one pixel may be in the single mask image of the single pressure plate, and the other pixel may be in the mask image of the non-single pressure plate.
[0075] In this embodiment, after obtaining the individual pressing plate mask images corresponding to each individual pressing plate, the server may perform edge straight line detection on each individual pressing plate mask image to determine the edge straight line of each individual pressing plate.
[0076] In this embodiment, the server performs edge line detection on each monomer mask image, which may include but is not limited to edge line detection based on the Canny edge detection algorithm, the line segment detection (LSD) algorithm, the Hough transform line detection algorithm, etc.
[0077] In one of the embodiments, a connected domain is extracted from the mask image to determine a monomer mask image corresponding to each monomer pressure plate, including: obtaining a pixel value of each pixel point in the mask image and a coordinate position of each pixel point; determining connected pixel points in the mask image according to each pixel value and each coordinate position; and determining a connected domain based on the connected pixel points to obtain a monomer mask image corresponding to each monomer pressure plate.
[0078] In this embodiment, the server establishes a pixel coordinate system on the mask image. For example, in opencv, the upper left corner of the mask image can be defined as the origin, the horizontal axis can be defined as the X axis, and the vertical axis can be defined as the Y axis.
[0079] Furthermore, the server obtains the pixel value of each pixel in the mask image, and obtains the coordinate position of each pixel in the mask image according to a pixel coordinate system established on the mask image.
[0080] In this embodiment, the server extracts connected domains of the mask image according to the pixel value of each pixel in the mask image and the coordinate position of each pixel, and determines whether the pixels in the mask image are connected.
[0081] The connected pixels in the mask image form a connected domain, that is, a single mask image of a single pressure plate or a non-single pressure plate area.
[0082] In one of the embodiments, the edge straight lines of each monomer pressure plate are determined, including: performing edge extraction on the monomer mask image of each monomer pressure plate to obtain edge information of each monomer pressure plate; determining the edge contour of each monomer pressure plate based on each edge information; segmenting each edge contour to generate corresponding contour line segments; clustering the contour line segments to obtain the edge straight lines corresponding to each monomer pressure plate.
[0083] In this embodiment, edge extraction refers to extracting the binary edges of the single mask images of each single pressing plate.
[0084] Among them, binarization means using only two colors to represent the interior (or background) and edge of the image respectively.
[0085] Specifically, if the color value of a pixel is close enough to the surrounding pixels (belonging to the low-frequency part), it is considered to be the image background or interior; if the color value of a pixel is very different from the surrounding pixels (belonging to the high-frequency part), it is considered to be the image edge.
[0086] In this embodiment, the server can obtain the maximum coordinate and minimum coordinate of the pixel points in the X direction and the maximum coordinate and minimum coordinate of the pixel points in the Y direction of each monomer pressure plate by traversing the pixel coordinates in the monomer mask image of each monomer pressure plate, and obtain the boundary edge rectangle of each monomer pressure plate, such as Figure 3 As shown in 5, 6, 7, and 8 in (c).
[0087] Furthermore, the server may perform edge extraction on the single mask image of each single pressing plate by using the Canny edge detection algorithm. Specifically, the server may perform edge extraction on the boundary edge rectangle determined on the single mask image of each single pressing plate.
[0088] In this embodiment, the server may obtain the pixel value of each pixel point within the boundary edge rectangle and the coordinate position of each pixel point, and then determine the edge contour of each single pressure plate based on the pixel value of each pixel point and the coordinate position of each pixel point.
[0089] Furthermore, the server may use a straight line segment detection algorithm to perform straight line segment detection on the edge contour of each single pressing plate to obtain a plurality of straight lines, that is, to obtain contour line segments corresponding to the edge contour.
[0090] Furthermore, the server can cluster similar contour segments using a clustering algorithm to obtain edge lines corresponding to each individual platen. The edge lines can be as follows: Figure 3 As shown in 10, 11, etc. in (d).
[0091] In one embodiment, the server may calculate the directional deviation angle and / or straight-line distance between contour line segments, and determine whether the contour line segments are similar contour line segments based on the determined directional deviation angle and / or straight-line distance.
[0092] In this embodiment, the direction deviation angle refers to the angle between the normal vectors of the contour line segments, and can be calculated based on the normal vectors of the two contour line segments. The straight-line distance refers to the distance between the two contour line segments.
[0093] In this embodiment, the server may determine that contour segments whose direction deviation angles are smaller than a direction threshold and / or contour segments whose distances are smaller than a distance threshold are similar contour segments.
[0094] Among them, for the direction threshold and distance threshold, the server can pre-set them based on the prior value of the pressure plate pixel spacing. For different application scenarios, the settings of the direction threshold and distance threshold may be different, and this application does not impose any restrictions on this.
[0095] In one of the embodiments, edge extraction is performed on the monomer mask image of each monomer pressure plate to obtain edge information of each monomer pressure plate, including: determining the mask pixel value and coordinate position of each pixel point in the monomer mask image according to the monomer mask image; determining the target pixel point of the corresponding monomer pressure plate based on each mask pixel value; and obtaining the edge information of the monomer pressure plate according to the coordinate position of the target pixel point.
[0096] In this embodiment, after the server extracts the connected domain of the mask image to obtain the corresponding monomer mask images, the server can obtain the pixel value and coordinate position of each pixel point in the monomer mask image according to the monomer mask image.
[0097] Further reference Figure 3 (b) For each single pressure plate, the server can determine each pixel point whose corresponding pixel value is white, that is, each target pixel point corresponding to the single pressure plate, and then determine the edge information of the single pressure plate according to the coordinate position of the determined target pixel point.
[0098] Specifically, the server extracts the edge information of the single platen based on the binary edge extraction of the single platen mask image of each single platen, so that the pixel points with different pixel values respectively indicate the background and edge in the single platen mask image, that is, the edge information of the single platen is extracted. For example, the background of the single platen mask image is black, and the edge of the single platen in the single platen mask image is white.
[0099] In one of the embodiments, based on each edge straight line, the pressure plate state of each individual pressure plate in the original pressure plate image is determined, including: determining the edge straight line angle of each individual pressure plate according to the edge straight line of each individual pressure plate; when the edge straight line angle is less than a first preset threshold, determining that the pressure plate state of the individual pressure plate is a closed state; when the edge straight line angle is greater than or equal to the first preset threshold and less than the second preset threshold, determining that the pressure plate state of the individual pressure plate is a semi-closed state; when the edge straight line angle is greater than or equal to the second preset threshold, determining that the pressure plate state of the individual pressure plate is an open state.
[0100] In this embodiment, after obtaining the edge straight line of the single pressure plate, the server can determine the state of the pressure plate by calculating the edge straight line angle between the two edge straight lines.
[0101] In this embodiment, the server can set a first preset threshold value T0 and a second preset threshold value T1. When the server determines that there are two straight lines whose edge straight line angle is less than the set first preset threshold value T0, the server can determine that the platen state of the single platen is a closed state; when the server determines that if there are two straight lines whose edge straight line angle is greater than the set first preset threshold value T0 and less than the set second preset threshold value T1, the platen state of the single platen is determined to be a semi-closed state; when the server determines that there are two straight lines whose edge straight line angle is greater than the set second preset threshold value T1, the platen state of the single platen is determined to be an open state.
[0102] In one of the embodiments, the server generates a corresponding mask image through a pre-trained mask generation model, and the training method of the mask generation model includes: obtaining a training image set, the training image set includes multiple training images, and each training image includes at least one single pressure plate; annotating the pressure plate in each training image, annotating the contour area and label of the pressure plate, and obtaining a labeled training image set; inputting the labeled training image set into a pre-constructed initial mask generation model, and using the initial mask generation model to segment the pressure plate in each training image according to the annotated label to generate a corresponding output mask image; based on the output mask image and the training image set, determining the model loss of the initial mask generation model; according to the model loss, iteratively training the initial mask generation model to obtain a trained mask model.
[0103] The source of the training image set may include, but is not limited to, historical image data sets collected by shooting equipment such as robots and video system cameras.
[0104] Among them, the model loss can be calculated using loss functions such as hinge loss function, exponential loss function, logarithmic loss function, square loss function, and absolute value loss function.
[0105] The training image set may include a training set, a test set, a validation set, etc. The server may use the data in the training set to train the model. Furthermore, the server calculates the error of the trained model on the test set and uses the error as the generalization error of the final model in dealing with real-world scenarios.
[0106] In this embodiment, the server annotates the image target of the platen in each training image, divides the platen image into a non-contour area and an inner-contour area, and fills the inner-contour area and the non-contour area of the platen image with labels. For example, based on the polygonal image target annotation method, the server annotates the contour of the platen in each training image, divides the platen image into a non-contour area and an inner-contour area, fills the inner-contour area of the platen image with a label "1", and fills the non-contour inner area of each individual platen image with a label "0".
[0107] Among them, the implementation tool for the server to perform image target labeling on the pressure plate in each training image may include but is not limited to image labeling tools such as labelme.
[0108] Furthermore, the server performs data preprocessing operations on each labeled training image, and inputs the labeled training image set of each training image after data preprocessing into a pre-built initial mask generation model. The initial mask generation model segments the pressure plate in each training image according to the labeled label to generate a corresponding output mask image.
[0109] In this embodiment, the above-mentioned segmentation of the pressure plate in each training image specifically refers to segmentation based on a semantic segmentation network.
[0110] Semantic segmentation refers to implementing pixel-level classification on an image. In this embodiment, the pixels on the platen image are divided into non-contour areas and areas within contours.
[0111] In this embodiment, the server may use an encoder-decoder architecture based on FCN (Fully Convolutional Networks) to perform semantic segmentation. Specifically, the network structure of FCN may be as follows: Figure 4 As shown, the server can input the RGB image into the FCN network, perform semantic segmentation through the FCN network, and output the semantically segmented image corresponding to the input image.
[0112] In this embodiment, the encoder in the encoder-decoder architecture refers to the encoder, which is mainly used to extract image features, and the decoder refers to the decoder, which is mainly responsible for upsampling the encoded feature map to the original image size.
[0113] Those skilled in the art will appreciate that when the server performs semantic segmentation on an image through a semantic segmentation network, it is not limited to a specific semantic segmentation network. In addition to the above-mentioned FCN network, a lightweight network structure may also be used, such as an efficient neural network (ENet), a multi-resolution branched image cascade network (ICNet), a deep feature aggregation network structure (Deep Feature Aggregation, DFANet), etc., or DeepLapv3, a pyramid scene parsing network (PSPNet), etc. may also be used. This application does not impose any restrictions on this.
[0114] In this embodiment, the data preprocessing operations performed by the server on each labeled training image may include but are not limited to mean subtraction processing, image standardization processing, image normalization processing, etc.
[0115] In this embodiment, the server can calculate the model loss based on the input training image and the obtained mask image, and iteratively update the model parameters based on the calculated model loss to obtain a trained mask generation model.
[0116] Furthermore, the server can test the trained mask generation model based on the test set data, and obtain the trained mask generation model after the test passes. If the test fails, the training data is used for retraining and retesting until the test passes.
[0117] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0118] In one embodiment, Figure 5 As shown, a device for determining a platen state is provided, which may include: an image acquisition module 100, a mask generation module 200, a mask image analysis module 300 and a platen state analysis module 400, wherein:
[0119] The image acquisition module 100 is used to acquire the original image of the pressing plate, where the original image of the pressing plate includes at least one single pressing plate.
[0120] The mask generation module 200 is used to generate a corresponding mask image based on the original image of the pressing plate.
[0121] The mask image analysis module 300 is used to determine the edge straight lines of each single pressing plate in the original pressing plate image according to the mask image.
[0122] The pressure plate state analysis module 400 is used to determine the pressure plate state of each individual pressure plate in the pressure plate original image based on each edge straight line.
[0123] In one embodiment, the mask image analysis module 300 may include:
[0124] The monomer mask image determination submodule is used to extract the connected domain of the mask image and determine the monomer mask image corresponding to each monomer pressure plate.
[0125] The edge line detection submodule is used to perform edge line detection on each monomer mask image to determine the edge line of each monomer pressure plate.
[0126] In one embodiment, the monomer mask image determination submodule may include:
[0127] The mask image pixel information acquisition unit is used to acquire the pixel value of each pixel point in the mask image and the coordinate position of each pixel point.
[0128] The mask image pixel point determination unit is used to determine connected pixel points in the mask image according to each pixel value and each coordinate position.
[0129] The monomer mask image acquisition unit is used to determine the connected domain based on the connected pixel points to obtain the monomer mask image corresponding to each monomer pressure plate.
[0130] In one embodiment, the edge line detection submodule may include:
[0131] The edge information extraction unit is used to extract the edge of the monomer mask image of each monomer pressing plate to obtain the edge information of each monomer pressing plate.
[0132] The edge contour determining unit is used to determine the edge contour of each single pressing plate based on each edge information.
[0133] The contour line segment generating unit is used to segment each edge contour and generate corresponding contour line segments.
[0134] The edge line acquisition unit is used to cluster the contour line segments to obtain the edge lines corresponding to each monomer pressure plate.
[0135] In one embodiment, the edge information extraction unit may include:
[0136] The single mask image pixel information acquisition subunit is used to determine the mask pixel value and coordinate position of each pixel point in the single mask image according to the single mask image.
[0137] The single pressure plate pixel point determination subunit is used to determine the target pixel point of the corresponding single pressure plate based on each mask pixel value.
[0138] The single pressure plate edge information acquisition subunit obtains the edge information of the single pressure plate according to the coordinate position of the target pixel point.
[0139] In one embodiment, the platen status analysis module 400 may include:
[0140] The edge straight line angle determination submodule is used to determine the edge straight line angle of each single pressure plate according to the edge straight line of each single pressure plate.
[0141] The closed state determination submodule is used to determine that the pressing plate state of the single pressing plate is a closed state when the edge straight line angle is less than a first preset threshold value.
[0142] The semi-closed state determination submodule is used to determine that the pressing plate state of the single pressing plate is a semi-closed state when the edge straight line angle is greater than or equal to a first preset threshold and less than a second preset threshold.
[0143] The open state determination submodule is used to determine that the pressing plate state of the single pressing plate is the open state when the edge straight line angle is greater than or equal to the second preset threshold.
[0144] In one of the embodiments, the above-mentioned device may also include: a model training module for generating a mask model.
[0145] In this embodiment, the model training module may include:
[0146] The training image set acquisition submodule is used to acquire a training image set, wherein the training image set includes a plurality of training images, and each training image includes at least one single pressing plate.
[0147] The training image set annotation submodule is used to annotate the pressure plate in each training image, annotate the contour area and label of the pressure plate, and obtain the annotated training image set.
[0148] The initial mask image generation submodule is used to input the annotated training image set into the pre-built initial mask generation model, and the initial mask generation model is used to segment the pressure plate in each training image according to the annotated labels to generate the corresponding output mask image.
[0149] The model loss determination submodule is used to determine the model loss of the initial mask generation model based on the output mask image and the training image set.
[0150] The training model iterative training submodule is used to iteratively train the initial mask generation model according to the model loss to obtain a trained mask model.
[0151] For the specific definition of the platen state determination device, please refer to the definition of the platen state determination method above, which will not be repeated here. Each module in the above-mentioned platen state determination device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0152] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store mask image data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for determining a platen state is implemented.
[0153] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0154] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: acquiring an original image of a pressure plate, wherein the original image of the pressure plate includes at least one individual pressure plate; generating a corresponding mask image based on the original image of the pressure plate; determining the edge straight lines of each individual pressure plate in the original image of the pressure plate according to the mask image; and determining the pressure plate state of each individual pressure plate in the original image of the pressure plate based on each edge straight line.
[0155] In one of the embodiments, when the processor executes the computer program, determining the edge straight lines of the monomer pressure plates according to the mask image may include: performing connected domain extraction on the mask image to determine the monomer mask images corresponding to each monomer pressure plate; performing edge straight line detection on each monomer mask image to determine the edge straight lines of each monomer pressure plate.
[0156] In one of the embodiments, when the processor executes the computer program, it realizes connected domain extraction of the mask image and determines the monomer mask image corresponding to each monomer pressure plate, which can include: obtaining the pixel value of each pixel point in the mask image and the coordinate position of each pixel point; determining the connected pixel points in the mask image according to each pixel value and each coordinate position; based on the connected pixel points, determining the connected domain to obtain the monomer mask image corresponding to each monomer pressure plate.
[0157] In one of the embodiments, when the processor executes the computer program, it determines the edge straight line of each monomer pressure plate, including: extracting the edge of the monomer mask image of each monomer pressure plate to obtain the edge information of each monomer pressure plate; based on each edge information, determining the edge contour of each monomer pressure plate; segmenting each edge contour to generate corresponding contour line segments; clustering the contour line segments to obtain the edge straight line corresponding to each monomer pressure plate.
[0158] In one of the embodiments, when the processor executes the computer program, it implements edge extraction of the monomer mask image of each monomer pressure plate to obtain edge information of each monomer pressure plate, including: determining the mask pixel value and coordinate position of each pixel point in the monomer mask image according to the monomer mask image; determining the target pixel point of the corresponding monomer pressure plate based on each mask pixel value; and obtaining the edge information of the monomer pressure plate according to the coordinate position of the target pixel point.
[0159] In one of the embodiments, when the processor executes the computer program, it determines the pressure plate state of each individual pressure plate in the original pressure plate image based on each edge straight line, including: determining the edge straight line angle of each individual pressure plate according to the edge straight line of each individual pressure plate; when the edge straight line angle is less than a first preset threshold, determining that the pressure plate state of the individual pressure plate is a closed state; when the edge straight line angle is greater than or equal to the first preset threshold and less than the second preset threshold, determining that the pressure plate state of the individual pressure plate is a semi-closed state; when the edge straight line angle is greater than or equal to the second preset threshold, determining that the pressure plate state of the individual pressure plate is an open state.
[0160] In one embodiment, the corresponding mask image is generated by a pre-trained mask generation model.
[0161] In this embodiment, the training method of the mask generation model implemented when the processor executes the computer program may include: obtaining a training image set, the training image set including multiple training images, each training image including at least one single pressure plate; annotating the pressure plate in each training image, annotating the contour area and label of the pressure plate, and obtaining a labeled training image set; inputting the labeled training image set into a pre-constructed initial mask generation model, and using the initial mask generation model to segment the pressure plate in each training image according to the annotated label to generate a corresponding output mask image; determining the model loss of the initial mask generation model based on the output mask image and the training image set; and iteratively training the initial mask generation model according to the model loss to obtain a trained mask model.
[0162] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: acquiring an original image of a pressure plate, the original image of the pressure plate including at least one individual pressure plate; generating a corresponding mask image based on the original image of the pressure plate; determining the edge straight lines of each individual pressure plate in the original image of the pressure plate according to the mask image; and determining the pressure plate state of each individual pressure plate in the original image of the pressure plate based on each edge straight line.
[0163] In one embodiment, when the computer program is executed by the processor, determining the edge straight lines of the individual pressure plates according to the mask image may include: extracting the connected domain of the mask image to determine the individual mask images corresponding to each individual pressure plate; performing edge straight line detection on each individual mask image to determine the edge straight lines of each individual pressure plate.
[0164] In one of the embodiments, when the computer program is executed by the processor, connected domain extraction is performed on the mask image to determine the monomer mask image corresponding to each monomer pressure plate, including: obtaining the pixel value of each pixel point in the mask image and the coordinate position of each pixel point; determining the connected pixel points in the mask image according to each pixel value and each coordinate position; based on the connected pixel points, determining the connected domain to obtain the monomer mask image corresponding to each monomer pressure plate.
[0165] In one embodiment, when the computer program is executed by the processor, it can determine the edge straight line of each monomer pressure plate, which can include: extracting the edge of the monomer mask image of each monomer pressure plate to obtain the edge information of each monomer pressure plate; determining the edge contour of each monomer pressure plate based on each edge information; segmenting each edge contour to generate corresponding contour line segments; clustering the contour line segments to obtain the edge straight line corresponding to each monomer pressure plate.
[0166] In one of the embodiments, when the computer program is executed by the processor, edge extraction of the monomer mask image of each monomer pressure plate is implemented to obtain edge information of each monomer pressure plate, which may include: determining the mask pixel value and coordinate position of each pixel point in the monomer mask image according to the monomer mask image; determining the target pixel point of the corresponding monomer pressure plate based on each mask pixel value; and obtaining the edge information of the monomer pressure plate according to the coordinate position of the target pixel point.
[0167] In one of the embodiments, when the computer program is executed by the processor, it is implemented to determine the pressure plate state of each individual pressure plate in the original pressure plate image based on each edge straight line, which may include: determining the edge straight line angle of each individual pressure plate according to the edge straight line of each individual pressure plate; when the edge straight line angle is less than a first preset threshold, determining that the pressure plate state of the individual pressure plate is a closed state; when the edge straight line angle is greater than or equal to the first preset threshold and less than the second preset threshold, determining that the pressure plate state of the individual pressure plate is a semi-closed state; when the edge straight line angle is greater than or equal to the second preset threshold, determining that the pressure plate state of the individual pressure plate is an open state.
[0168] In one embodiment, the corresponding mask image is generated by a pre-trained mask generation model.
[0169] In this embodiment, when the computer program is executed by the processor, a training method for implementing a mask generation model may include: obtaining a training image set, the training image set including multiple training images, each training image including at least one single pressure plate; annotating each single pressure plate in each training image, annotating the contour area and label of each single pressure plate, and obtaining a labeled training image set; inputting the labeled training image set into a pre-constructed initial mask generation model, and using the initial mask generation model to segment the single pressure plate in each training image according to the annotated label to generate a corresponding output mask image; determining the model loss of the initial mask generation model based on the output mask image and the training image set; and iteratively training the initial mask generation model according to the model loss to obtain a trained mask model.
[0170] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0171] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0172] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for determining a platen state, characterized in that: The method comprises: Collecting an original image of a pressing plate, wherein the original image of the pressing plate includes at least one single pressing plate; Based on the original image of the pressing plate, generating a corresponding mask image; Determine the edge straight line of each single pressing plate in the original pressing plate image according to the mask image; Based on the edge straight lines, determining the pressing plate state of each individual pressing plate in the pressing plate original image; The step of determining the pressing plate state of each single pressing plate in the pressing plate original image based on each edge straight line includes: According to the edge straight lines of each single pressing plate, the included angle of the edge straight lines of each single pressing plate is determined; When the edge straight line angle is less than a first preset threshold, determining that the pressing plate state of the single pressing plate is a closed state; When the edge straight line angle is greater than or equal to the first preset threshold and less than the second preset threshold, determining that the pressing plate state of the single pressing plate is a semi-closed state; When the edge straight line angle is greater than or equal to the second preset threshold, determining that the pressing plate state of the single pressing plate is an open state; Determining the edge straight line of the monomer pressing plate according to the mask image includes: performing connected domain extraction on the mask image to determine the monomer mask image corresponding to each monomer pressing plate; performing edge straight line detection on each monomer mask image to determine the edge straight line of each monomer pressing plate; The connected domain extraction of the mask image to determine the monomer mask image corresponding to each monomer pressure plate includes: obtaining the pixel value of each pixel point in the mask image and the coordinate position of each pixel point; determining the connected pixel points in the mask image according to each pixel value and each coordinate position; determining the connected domain based on the connected pixel points to obtain the monomer mask image corresponding to each monomer pressure plate; in the mask image, if pixel point A and pixel point B are adjacent and the pixel values of pixel point A and pixel point B are equal, it is determined that pixel point A is connected to pixel point B; if two pixel points on the mask image are connected, then the pixel points are in one of the connected domains; The method of determining the edge straight line of each monomer pressure plate includes: performing edge extraction on the monomer mask image of each monomer pressure plate to obtain edge information of each monomer pressure plate; the edge information is the boundary edge rectangle information of each monomer pressure plate; based on each edge information, determining the edge contour of each monomer pressure plate; segmenting each edge contour to generate corresponding contour line segments; clustering the contour line segments to obtain the edge straight line corresponding to each monomer pressure plate.
2. The method according to claim 1, characterized in that The step of extracting the edge of the monomer mask image of each monomer pressing plate to obtain the edge information of each monomer pressing plate includes: According to the single mask image, determining the mask pixel value and coordinate position of each pixel point in the single mask image; Based on each of the mask pixel values, determining a target pixel point corresponding to the single pressure plate; According to the coordinate position of the target pixel point, the edge information of the single pressure plate is obtained.
3. The method according to claim 1, characterized in that The step of determining the edge profile of each single platen based on each edge information includes: A straight line segment detection algorithm is used to perform straight line segment detection on the edge contour of each single pressing plate to obtain a plurality of straight lines, that is, to obtain contour line segments corresponding to the edge contour.
4. The method according to claim 1, characterized in that: The generated corresponding mask image is generated by a pre-trained mask generation model, and the training method of the mask generation model includes: Acquire a training image set, wherein the training image set includes a plurality of training images, and each of the training images includes at least one single pressing plate; Annotating the pressing plate in each of the training images, annotating the contour area and label of the pressing plate, and obtaining a labeled training image set; Inputting the annotated training image set into a pre-built initial mask generation model, segmenting the pressure plate in each of the training images according to the annotated labels through the initial mask generation model to generate a corresponding output mask image; Determining a model loss of the initial mask generation model based on the output mask image and the training image set; The initial mask generation model is iteratively trained according to the model loss to obtain a trained mask model.
5. A device for determining a platen state, characterized in that: The device comprises: An image acquisition module is used to acquire an original image of a pressing plate, wherein the original image of the pressing plate includes at least one single pressing plate; A mask generation module generates a corresponding mask image based on the original image of the pressing plate; A mask image analysis module, which determines the edge straight lines of each single pressing plate in the original pressing plate image according to the mask image; A pressure plate state analysis module determines the pressure plate state of each individual pressure plate in the pressure plate original image based on each edge straight line, and determines the edge straight line angle of each individual pressure plate according to the edge straight line of each individual pressure plate; when the edge straight line angle is less than a first preset threshold, the pressure plate state of the individual pressure plate is determined to be a closed state; when the edge straight line angle is greater than or equal to the first preset threshold and less than a second preset threshold, the pressure plate state of the individual pressure plate is determined to be a semi-closed state; when the edge straight line angle is greater than or equal to the second preset threshold, the pressure plate state of the individual pressure plate is determined to be an open state; The mask image analysis module comprises: A monomer mask image determination submodule is used to extract the connected domain of the mask image and determine the monomer mask image corresponding to each monomer pressing plate; An edge line detection submodule, used to perform edge line detection on each of the monomer mask images to determine the edge line of each of the monomer pressing plates; The monomer mask image determination submodule includes: The mask image pixel information acquisition unit is used to determine the single body mask image corresponding to each single body pressing plate, including: acquiring the pixel value of each pixel point in the mask image and the coordinate position of each pixel point; A mask image pixel point determination unit, used to determine connected pixel points in the mask image according to each of the pixel values and each of the coordinate positions; A monomer mask image acquisition unit, used to determine a connected domain based on connected pixels, and obtain a monomer mask image corresponding to each of the monomer pressure plates; if pixel A and pixel B are adjacent in the mask image, and the pixel values of pixel A and pixel B are equal, it is determined that pixel A is connected to pixel B; if two pixels on the mask image are connected, then the pixels are in one of the connected domains; The edge straight line detection submodule includes: An edge information extraction unit is used to extract edges from the monomer mask images of each monomer pressing plate to obtain edge information of each monomer pressing plate; An edge contour determining unit, used to determine the edge contour of each single pressing plate based on each of the edge information; the edge information is the boundary edge rectangle information of each of the single pressing plates; A contour line segment generating unit, used for segmenting each edge contour to generate corresponding contour line segments; The edge line acquisition unit is used to cluster the contour line segments to obtain edge lines corresponding to each single pressure plate.
6. The device according to claim 5, characterized in that The edge information extraction unit comprises: A single mask image pixel information acquisition subunit, used to determine the mask pixel value and coordinate position of each pixel point in the single mask image according to the single mask image; A single pressure plate pixel point determination subunit, used for determining a target pixel point corresponding to the single pressure plate based on each of the mask pixel values; The single pressure plate edge information acquisition subunit is used to obtain the edge information of the single pressure plate according to the coordinate position of the target pixel point.
7. The device according to claim 5, characterized in that The edge contour determination unit is further used to perform straight line segment detection on the edge contour of each single pressing plate using a straight line segment detection algorithm to obtain a plurality of straight lines, that is, to obtain contour line segments corresponding to the edge contour.
8. The device according to claim 5, characterized in that The device comprises a model training module; the model training module is used to generate a mask generation model; The mask generation model includes: A training image set acquisition submodule, used to acquire a training image set, wherein the training image set includes a plurality of training images, each of which includes at least one single pressing plate; A training image set annotation submodule is used to annotate the pressing plate in each of the training images, annotate the contour area and label of the pressing plate, and obtain annotated training image set; An initial mask image generation submodule is used to input the annotated training image set into a pre-built initial mask generation model, and segment the pressure plate in each of the training images according to the annotated labels through the initial mask generation model to generate a corresponding output mask image; A model loss determination submodule, configured to determine a model loss of the initial mask generation model based on the output mask image and the training image set; The training model iterative training submodule is used to iteratively train the initial mask generation model according to the model loss to obtain a trained mask model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Pressing plate identification method and device
CN110020643A
Method and device for determining opening-closing state of knife switch
CN110163833A
Split knife switch opening and closing angle detection method based on automatic positioning
CN110689528A
Image data processing method, device and equipment and medium
CN112052839A
Transformer substation pressing plate state identification method and device
CN112528741A