Image processing method and device, terminal equipment and storage medium
Through image processing and deep learning models, the working mode of railway system equipment is automatically identified, which solves the problem of low efficiency in the existing technology and achieves efficient, accurate and automated identification of equipment working modes.
Patent Information
- Application Number
- CN202410482643.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, determining the working mode of railway system equipment requires manual on-site inspection, which is inefficient and lacks automated identification methods.
Through the image processing method, the device dial image is obtained, preprocessed and deep learning model recognition is performed, the counting data and mode status are determined, and the automatic recognition and display of the device working mode is realized.
It improves the efficiency and accuracy of determining the equipment working mode, reduces manual intervention, and realizes automated monitoring.
Smart Images

Figure CN118570785A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to an image processing method, apparatus, terminal device and storage medium. Background Art
[0002] With the continuous development of monitoring technology, the fields of monitoring application are also increasing. For example, in the railway system, it is necessary to monitor various equipment and various parameters of the equipment, and to monitor the working modes of different equipment. At present, manual detection with measuring tools is required to determine the working mode of the equipment. How to improve the efficiency of determining the working mode is an urgent problem to be solved. Summary of the invention
[0003] The present application intends to provide an image processing method, apparatus, terminal device and storage medium to solve the deficiencies in the prior art. The technical problem to be solved by the present application is achieved through the following technical solutions.
[0004] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0005] Obtain an image to be recognized;
[0006] Preprocessing the image to be identified to obtain a processed image;
[0007] Determine the count data of various types of tables corresponding to the processed image according to the processed image and the pre-trained recognition model;
[0008] determining, based on the count data, a mode state of a device corresponding to the count data;
[0009] Displays the mode status of the device.
[0010] Optionally, the pre-trained recognition model is obtained by:
[0011] Acquire a first sample image;
[0012] Performing morphological processing on the sample image to obtain a second sample image;
[0013] Training the initial network model according to the second sample image;
[0014] If the loss function is less than a preset value, the initial network model is determined as the recognition model.
[0015] Optionally, determining, according to the counting data, a mode state of a device corresponding to the counting data includes:
[0016] Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range;
[0017] The mode state of the device corresponding to the counting data is determined according to the position information of the pointer in the dial.
[0018] Optionally, preprocessing the image to be identified to obtain a processed image includes:
[0019] Morphological processing is performed on the image to be identified, and the contour and the target area position in the image to be identified are marked to obtain a processed image.
[0020] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:
[0021] An acquisition module, used for acquiring an image to be recognized;
[0022] A processing module, used for preprocessing the image to be identified to obtain a processed image;
[0023] A first determination module, used to determine the count data of various tables corresponding to the processed image according to the processed image and a pre-trained recognition model;
[0024] A second determination module, configured to determine a mode state of a device corresponding to the counting data according to the counting data;
[0025] The display module is used to display the mode status of the device.
[0026] Optionally, the device further comprises a model training module, wherein the model training module is used to:
[0027] Acquire a first sample image;
[0028] Performing morphological processing on the sample image to obtain a second sample image;
[0029] Training the initial network model according to the second sample image;
[0030] If the loss function is less than a preset value, the initial network model is determined as the recognition model.
[0031] Optionally, the second determining module is used to:
[0032] Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range;
[0033] The mode state of the device corresponding to the counting data is determined according to the position information of the pointer in the dial.
[0034] Optionally, the processing module is used to:
[0035] Morphological processing is performed on the image to be identified, and the contour and the target area position in the image to be identified are marked to obtain a processed image.
[0036] In a third aspect, an embodiment of the present application provides a terminal device, including: at least one processor and a memory;
[0037] The memory stores a computer program; the at least one processor executes the computer program stored in the memory to implement the image processing method provided in the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the image processing method provided in the first aspect is implemented.
[0039] The embodiments of the present application include the following advantages:
[0040] The image processing method, apparatus, terminal device and storage medium provided in the embodiments of the present application obtain an image to be identified; pre-process the image to be identified to obtain a processed image; determine the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determine the mode state of a device corresponding to the count data based on the count data; and display the mode state of the device. The embodiments of the present application obtain an image to be identified and use a pre-trained recognition model to identify the count data of various tables in the image to be processed, and then determine the mode state of the device corresponding to the count data based on the count data, and display the mode state of the device on an interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, 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 recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 This is a flow chart of an image processing method in one embodiment of the present application;
[0043] Figure 2 is a structural block diagram of an embodiment of an image processing device of the present application;
[0044] Figure 3 It is a structural diagram of a terminal device of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0046] Reference Figure 1 , shows a flowchart of an image processing method embodiment of the present application, the method may specifically include the following steps:
[0047] S101, obtaining an image to be recognized;
[0048] Specifically, the terminal device obtains the image to be identified collected by a camera or an intelligent inspection robot, and the image to be identified may be an image of a dial on each monitoring device.
[0049] S102, preprocessing the image to be recognized to obtain a processed image;
[0050] Specifically, the terminal device converts the image to be identified into a binary image, and performs morphological processing on the binary image, that is, processes the image size and image channels to obtain a processed image, wherein the morphological processing includes at least segmentation, feature extraction and object recognition, which form the basis of the technology for extracting "meaning" from the image. The algorithms based on morphological processing are corrosion, expansion, opening operation, closing operation, hit or miss transformation. Some basic applications mainly include boundary extraction, hole filling, connected component extraction, convex hull, thinning, coarsening, skeleton extraction, etc. Morphological technology uses small shapes or templates called structural elements to detect images.
[0051] S103, determining the count data of various tables corresponding to the processed image according to the processed image and the pre-trained recognition model;
[0052] The terminal device pre-trains the initial network model based on the first sample image, wherein the first sample image may be an image of each dial, in which the display data is annotated, and the display data may be a numerical value or a pointer. The initial network model at least includes:
[0053] 1. Convolutional Neural Network (CNN): Convolutional neural network is a neural network used for image and spatial data processing. It captures local features of images through convolutional layers and pooling layers and is widely used in image classification, object detection and other fields.
[0054] 2. Recurrent Neural Network (RNN): Recurrent neural networks are suitable for processing sequential data, such as time series and text. By introducing the time dimension, RNN can consider the contextual information of the data. Variants such as LSTM and GRU solve the gradient problem of traditional RNN and are widely used in tasks such as language models and text generation.
[0055] 3. Generative Adversarial Network (GAN): Generative Adversarial Network consists of a generator and a discriminator to generate realistic data samples. The generator tries to generate samples similar to real data, and the discriminator strives to distinguish between real and generated samples. GAN has created many remarkable results in the fields of image generation, style transfer, etc.
[0056] 4. Graph Neural Network (GNN): Graph Neural Network is specially designed to process graph data and can learn the representation of nodes and edges. It has applications in tasks such as social network analysis and molecular prediction, and has excellent performance in tasks such as node classification and link prediction.
[0057] 5. Long Short-Term Memory Network (LSTM): Long Short-Term Memory Network is a variant of recurrent neural network, which is specially designed to solve long sequence tasks. Through the gating mechanism, LSTM can better capture the long-term dependencies in the sequence and is suitable for tasks such as speech recognition and natural language generation.
[0058] 6. Artificial Neural Network (ANN): ANN is the basic form of neural network, which consists of neurons, weights and activation functions. Multilayer Perceptron (MLP) is its common form and is used in various tasks such as image recognition, data classification, etc.
[0059] 7. Autoencoder: Autoencoder is a neural network used to learn data representation. It learns the compressed representation of data through encoding and decoding processes. It has applications in data dimensionality reduction, denoising, feature learning, etc.
[0060] 8. Transformer: Transformer is a neural network based on self-attention mechanism, which is used to process sequence data, such as natural language text. It is widely used in the field of NLP for tasks such as translation, generation, and sentiment analysis.
[0061] The terminal device inputs the processed image into a pre-trained recognition model to identify the count data of various types of tables in the processed image.
[0062] S104, determining a mode state of a device corresponding to the counting data according to the counting data;
[0063] Specifically, the terminal device judges the counting data according to the obtained counting data, and determines the mode state of the device corresponding to the counting data according to the judgment result.
[0064] Exemplarily, if the obtained counting data is voltage, it means that the mode state of the corresponding device is the voltage monitoring state. If the obtained counting data is current, it means that the mode state of the corresponding device is the current monitoring state. Furthermore, it is also possible to judge whether the voltage or current is within a preset range. At this time, the mode state displayed by each device is a normal working state or an abnormal working state.
[0065] S105: Display the mode status of the device.
[0066] The mode status of the device is displayed on the interface of the terminal device.
[0067] In the embodiments of the present application, an intelligent inspection robot is integrated with video surveillance to realize information collection of intelligent monitoring equipment and transmission and sharing of stream-type and numerical-type collected information, and to study the implementation method of pattern recognition and alarm linkage.
[0068] The embodiment of the present application performs morphological processing on the image, transforms the image size and channels, completes image preprocessing (contour marking, target area positioning, etc.) through hyperparameter settings such as thresholds, and then performs deep learning feature extraction and classification on the preprocessed image. For the problem of image separation and combination, the image is classified into combined categories, and the image meter reading is identified and located. The angle of the image pointer is determined by parameters such as the range. Flexible use of a variety of deep learning model libraries improves recognition accuracy and speed and improves system performance. Image recognition is achieved through technical means such as image preprocessing, deep learning, and unified packaging, and then the mode status of each meter, primary and secondary equipment, etc. is realized, achieving the goal of alarm linkage and integrated auxiliary monitoring.
[0069] The image processing method provided by the embodiment of the present application obtains an image to be recognized; pre-processes the image to be recognized to obtain a processed image; determines the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determines the mode state of a device corresponding to the count data based on the count data; and displays the mode state of the device. The embodiment of the present application obtains an image to be recognized and uses a pre-trained recognition model to recognize the count data of various tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on an interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0070] Another embodiment of the present application further supplements the image processing method provided by the above embodiment.
[0071] Optionally, the pre-trained recognition model is obtained by:
[0072] Acquire a first sample image;
[0073] Performing morphological processing on the sample image to obtain a second sample image;
[0074] Training the initial network model according to the second sample image;
[0075] If the loss function is less than the preset value, the initial network model is determined as the recognition model.
[0076] In the embodiment of the present application, a first sample image is obtained, and the instrument dial in the first sample image is segmented into multiple regions using a connected domain detection algorithm and a rectangle fitting algorithm; then these regions are detected using prior knowledge, and the connected domains representing the pointer region and the digital region are retained; the two connected domains are again fitted with a minimum area rectangle to obtain two rectangles with deflection angles; the image is rotationally corrected according to the angle, and then the pointer and digital regions are segmented from the corrected image, and the segmented pointer and digital regions are morphologically processed to obtain a second sample image; finally, the initial network model is trained based on the second sample image; if the loss function is less than a preset value, the initial network model is determined as a recognition model. The recognition model is used to recognize the instrument readings in the image.
[0077] Optionally, determining, according to the counting data, a mode state of a device corresponding to the counting data includes:
[0078] Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range;
[0079] According to the position information of the pointer in the dial, the mode state of the device corresponding to the counting data is determined.
[0080] Optionally, preprocessing the image to be identified to obtain a processed image includes:
[0081] The image to be identified is subjected to morphological processing, the contour and the position of the target area in the image to be identified are marked, and a processed image is obtained.
[0082] The image processing method provided by the embodiment of the present application obtains an image to be recognized; pre-processes the image to be recognized to obtain a processed image; determines the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determines the mode state of a device corresponding to the count data based on the count data; and displays the mode state of the device. The embodiment of the present application obtains an image to be recognized and uses a pre-trained recognition model to recognize the count data of various tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on an interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0083] Another embodiment of the present application provides an image processing device for executing the image processing method provided in the above embodiment.
[0084] Reference Figure 2 , shows a structural block diagram of an embodiment of an image processing device of the present application, the device may specifically include the following modules: an acquisition module 201, a processing module 202, a first determination module 203, a second determination module 204 and a display module 205, wherein:
[0085] The acquisition module 201 is used to acquire the image to be recognized;
[0086] The processing module 202 is used to pre-process the image to be identified to obtain a processed image;
[0087] The first determination module 203 is used to determine the count data of various tables corresponding to the processed image according to the processed image and the pre-trained recognition model;
[0088] The second determination module 204 is used to determine the mode state of the device corresponding to the counting data according to the counting data;
[0089] The display module 205 is used to display the mode status of the device.
[0090] The image processing device provided by the embodiment of the present application obtains an image to be recognized; pre-processes the image to be recognized to obtain a processed image; determines the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determines the mode state of a device corresponding to the count data based on the count data; and displays the mode state of the device. The embodiment of the present application obtains an image to be recognized and uses a pre-trained recognition model to recognize the count data of various tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on an interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0091] Another embodiment of the present application further supplements the image processing device provided in the above embodiment.
[0092] Optionally, the second determining module is used to:
[0093] Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range;
[0094] According to the position information of the pointer in the dial, the mode state of the device corresponding to the counting data is determined.
[0095] Optionally, the processing module is used to:
[0096] The image to be identified is subjected to morphological processing, the contour and the position of the target area in the image to be identified are marked, and a processed image is obtained.
[0097] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0098] The image processing device provided by the embodiment of the present application obtains an image to be recognized; pre-processes the image to be recognized to obtain a processed image; determines the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determines the mode state of a device corresponding to the count data based on the count data; and displays the mode state of the device. The embodiment of the present application obtains an image to be recognized and uses a pre-trained recognition model to recognize the count data of various tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on an interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0099] Yet another embodiment of the present application provides a terminal device for executing the image processing method provided in the above embodiment.
[0100] Figure 3 It is a schematic diagram of the structure of a terminal device of the present application, such as Figure 3 As shown, the terminal device includes: at least one processor 301 and a memory 302;
[0101] The memory stores a computer program; and at least one processor executes the computer program stored in the memory to implement the image processing method provided in the above embodiment.
[0102] The terminal device provided by the present embodiment obtains an image to be recognized; pre-processes the image to be recognized to obtain a processed image; determines the count data of various tables corresponding to the processed image based on the processed image and a pre-trained recognition model; determines the mode state of the device corresponding to the count data based on the count data; and displays the mode state of the device. The embodiment of the present application obtains an image to be recognized and adopts a pre-trained recognition model to recognize the count data of various tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on the interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0103] Yet another embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the image processing method provided by any of the above embodiments is implemented.
[0104] According to the computer-readable storage medium of the present embodiment, an image to be identified is acquired; the image to be identified is preprocessed to obtain a processed image; the count data of various types of tables corresponding to the processed image are determined based on the processed image and a pre-trained recognition model; the mode state of the device corresponding to the count data is determined based on the count data; and the mode state of the device is displayed. The embodiment of the present application acquires an image to be identified and adopts a pre-trained recognition model to identify the count data of various types of tables in the image to be processed, and then determines the mode state of the device corresponding to the count data based on the count data, and displays the mode state of the device on the interface, thereby improving the accuracy of counting data recognition and the efficiency of determining the working mode of the device.
[0105] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.
[0106] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0107] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0108] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0109] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.
[0110] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.
[0111] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Obtain an image to be recognized; Preprocessing the image to be identified to obtain a processed image; Determine the count data of various types of tables corresponding to the processed image according to the processed image and the pre-trained recognition model; determining, based on the count data, a mode state of a device corresponding to the count data; Displays the mode status of the device.
2. The image processing method according to claim 1, characterized in that: The pre-trained recognition model is obtained in the following way: Acquire a first sample image; Performing morphological processing on the sample image to obtain a second sample image; Training the initial network model according to the second sample image; If the loss function is less than a preset value, the initial network model is determined as the recognition model.
3. The image processing method according to claim 1, characterized in that: The determining, according to the counting data, a mode state of a device corresponding to the counting data comprises: Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range; The mode state of the device corresponding to the counting data is determined according to the position information of the pointer in the dial.
4. The image processing method according to claim 1, characterized in that: The preprocessing of the image to be identified to obtain a processed image includes: Morphological processing is performed on the image to be identified, and the contour and the target area position in the image to be identified are marked to obtain a processed image.
5. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be recognized; A processing module, used for preprocessing the image to be identified to obtain a processed image; A first determination module, used to determine the count data of various tables corresponding to the processed image according to the processed image and a pre-trained recognition model; A second determination module, configured to determine a mode state of a device corresponding to the counting data according to the counting data; The display module is used to display the mode status of the device.
6. The image processing device according to claim 5, characterized in that: The device also includes a model training module, which is used to: Acquire a first sample image; Performing morphological processing on the sample image to obtain a second sample image; Training the initial network model according to the second sample image; If the loss function is less than a preset value, the initial network model is determined as the recognition model.
7. The image processing device according to claim 5, characterized in that: The second determining module is used for: Determine the position information of the pointer in the dial according to the counting data, the pre-stored image pointer angle and the dial range; The mode state of the device corresponding to the counting data is determined according to the position information of the pointer in the dial.
8. The image processing device according to claim 5, characterized in that: The processing module is used for: Morphological processing is performed on the image to be identified, and the contour and the target area position in the image to be identified are marked to obtain a processed image.
9. A terminal device, characterized in that: include: at least one processor and memory; The memory stores a computer program; The at least one processor executes the computer program stored in the memory to implement the image processing method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the image processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Automatic pointer type instrument reading identification method based on scale searching
CN109993166A
Method for realizing intelligent reading of ammeter data
CN110781884A
Instrument panel pointer reading identification method and device, computer equipment and storage medium
CN112115893A
Method and system for distinguishing oil level of transformer in power distribution room and medium
CN115409803A
Data entry method, device and equipment and storage medium
CN116682124A
