CN115393589A - Universal DCS process flow chart identification conversion method, system and medium - Google Patents

Universal DCS process flow chart identification conversion method, system and medium Download PDF

Info

Publication number
CN115393589A
CN115393589A CN202211027308.6A CN202211027308A CN115393589A CN 115393589 A CN115393589 A CN 115393589A CN 202211027308 A CN202211027308 A CN 202211027308A CN 115393589 A CN115393589 A CN 115393589A
Authority
CN
China
Prior art keywords
image
equipment
line
information
process flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211027308.6A
Other languages
Chinese (zh)
Inventor
陈佳伊
陈卓
叶铭阳
王吉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Supcon Technology Co Ltd
Original Assignee
Zhejiang Supcon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Supcon Technology Co Ltd filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN202211027308.6A priority Critical patent/CN115393589A/en
Publication of CN115393589A publication Critical patent/CN115393589A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/457Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/763Non-hierarchical techniques, e.g. based on statistics of modelling distributions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention relates to a method, a system and a medium for identifying and converting a general DCS process flow chart, wherein the method comprises the following steps: carrying out a preprocessing process comprising graying, binaryzation, filtering and morphological processing on the obtained process flow diagram to obtain a separated equipment image and a separated field image; recognizing characters and line segments in the field image to obtain character information and line segment information, and recognizing the equipment outline in the equipment image to obtain equipment information; screening out effective equipment connecting lines according to the equipment information and the line segment information; and redrawing a flow chart based on the text information, the equipment information and the effective equipment connection line. The invention provides a DCS process flow chart identification and conversion method, which can identify and automatically convert flow charts of different systems into flow charts of the current system through machine vision so as to achieve the purpose of being compatible with the flow charts of different DCS operating systems.

Description

Universal DCS process flow chart identification conversion method, system and medium
Technical Field
The invention relates to the technical field of image recognition, in particular to a method, a system and a medium for recognizing and converting a general DCS process flow chart.
Background
At present, the image recognition of the process flow chart is mainly on the recognition of a single instrument image and flow chart data, in the actual use process, flow chart formats built on different DCS operating systems cannot be compatible with each other, operators often need to redraw the flow chart, and for personnel who just contact the DCS industry, graphic symbols of other systems are unfamiliar, so that the situation that the drawings cannot be read correctly often exists, the error rate of manual hand-drawing of the flow chart is high, meanwhile, the redrawing work of a large amount of flow charts occupies great resources, the later-stage checking is very complicated, and the production work efficiency of a factory is greatly reduced.
Disclosure of Invention
Technical problem to be solved
In view of the above disadvantages and deficiencies of the prior art, the present invention provides a method, a system and a medium for identifying and converting a general DCS process flow diagram, which solves the technical problems of large workload of drawing the process flow diagram and low factory production efficiency caused by different primitive shapes and line patterns of the process flow diagram on different DCS systems.
(II) technical scheme
In order to achieve the purpose, the invention adopts the main technical scheme that:
in a first aspect, an embodiment of the present invention provides a method for identifying and converting a general DCS process flow diagram, including:
carrying out a preprocessing process comprising graying, binaryzation, filtering and morphological processing on the obtained process flow diagram to obtain a separated equipment image and a separated field image;
recognizing characters and line segments in the field image to obtain character information and line segment information, and recognizing the equipment outline in the equipment image to obtain equipment information;
screening out effective equipment connecting lines according to the equipment information and the line segment information;
and redrawing the flow chart based on the text information, the equipment information and the effective equipment connection line.
Optionally, the step of performing a preprocessing process including graying, binarization, filtering and morphological processing on the obtained process flow diagram to obtain a separated device image and a separated field image includes:
converting the acquired process flow diagram into a single-channel grey-scale diagram;
carrying out binarization processing on the single-channel gray-scale image according to a background mask image generated by a K-Means clustering algorithm;
and carrying out median filtering on the binarized image, and then carrying out morphological operation to separate a field image containing characters and line segments and an equipment image containing a plurality of equipment.
Optionally, the binarizing processing on the single-channel gray scale map according to the background mask image generated by the K-Means clustering algorithm includes:
establishing a sample data set based on the acquired process flow diagram;
clustering all sample points in the sample data set by adopting a K-Means algorithm so as to segment the background of the process flow chart;
acquiring any edge pixel point belonging to the background, and finding out the pixel points belonging to the same category label according to the category label of the pixel point;
and generating a background mask image based on all the found pixel points of the same category, and carrying out binarization processing on the gray-scale image according to the mask image.
Optionally, performing median filtering on the binarized image, and then performing morphological operation to separate a field image containing characters and line segments and an apparatus image containing a plurality of apparatuses includes:
performing convolution processing on the 3 x 3 filtering kernel to filter the binarized image;
closing the filtered image to obtain an equipment image only retaining a plurality of equipment;
and subtracting the image of the equipment image from the binarized image to obtain a field image only retaining characters and line segments.
Optionally, recognizing the text and the line segment in the field image to obtain text information and line segment information includes:
performing OCR character recognition on the binarized image, eliminating characters in the field image according to a character recognition result, and only keeping line segments;
performing preliminary detection on a solid line of a field image only keeping line segments through Hough transform detection;
traversing all the solid lines obtained by the primary detection, and classifying the solid lines with the distance smaller than 3 into the same class;
after sorting the solid lines in the same class according to the coordinates, calculating the solid line spacing according to the sorting order, and merging the solid lines with the solid line spacing smaller than 3 into one line.
Optionally, after sorting the solid lines in the same class according to coordinates, calculating the solid line spacing according to the sorting order, and merging the solid lines with the solid line spacing smaller than 3 into one line, the method further includes:
eliminating the solid line in the field image of the reserved line segment only according to the solid line obtained by the preliminary detection;
opening the field image of the only reserved line segment with the solid line eliminated so as to connect the dotted lines;
performing solid line detection again on the field image of the reserved line segment after the opening operation, and further processing to screen out repeated solid lines;
traversing all the dotted lines, and classifying the dotted lines with the distance smaller than 3 into the same class;
after the dotted lines in the same class are sorted according to the coordinates, the dotted line spacing is calculated according to the sorting sequence, and the dotted lines with the dotted line spacing smaller than 3 are combined into a dotted line.
Optionally, identifying the device outline in the device image to obtain device information includes:
performing canny edge detection and binarization on each device of the device image;
obtaining a connected domain of each device according to calculation to obtain the outline of each device;
calculating the area and the perimeter of the outline of each device, and screening out noise points smaller than a preset threshold value;
traversing the outlines of the screened devices to obtain the area of the outline of each device and the length and the width of the circumscribed rectangle;
judging whether the outline is rectangular or not according to the ratio of multiplying the area by the length and the width;
if the current time is not the rectangle, the current time is judged to be the application equipment;
if the contour is a rectangle, judging the contour to be application equipment when text information does not exist around and/or in the rectangle;
if the outline is a rectangle, judging that the outline is a data display control when text information exists around and/or inside the rectangle;
the application device is characterized in that the edge outline of the application device is an irregular graph, the edge outline of the data display control is rectangular, text information exists around and/or inside the data display control, and the text information comprises position number information.
Optionally, screening out an effective device connection line according to the device information and the line segment information includes:
grouping all the solid lines, and grouping the connected solid lines into one group;
traversing all solid line groups to find out the outer end points of all solid lines;
traversing all outer end points of the solid line, judging whether the outer end points are connected with the equipment, and if not, deleting the solid line of the end point;
and the number of the first and second groups,
grouping all the broken lines, and grouping the connected broken lines into a group;
traversing all the virtual line groups to find out the outer end points of all the virtual lines;
and traversing all the outer end points of the dotted line, judging whether the outer end points have the equipment connected with the outer end points, and if not, deleting the solid lines of the end points.
In a second aspect, an embodiment of the present invention provides a general DCS process flow diagram identification and conversion system, including:
the image separation module is used for carrying out preprocessing processes including graying, binaryzation, filtering and morphological processing on the acquired process flow diagram to obtain a separated equipment image and a separated field image;
the identification module is used for identifying characters and line segments in the field image to obtain character information and line segment information, and identifying the equipment outline in the equipment image to obtain equipment information;
the screening module is used for screening out effective equipment connecting lines according to the equipment information and the line segment information;
and the redrawing module is used for redrawing the flow chart based on the text information, the equipment information and the effective equipment connection line.
In a third aspect, embodiments of the present invention provide a computer-readable medium having stored thereon computer-executable instructions, which when executed by a processor, implement a general DCS process flow diagram identification conversion method as described above.
(III) advantageous effects
The invention has the beneficial effects that: the invention provides a universal processing mode, which can effectively convert process flow charts on different DCS systems, the identification accuracy rate of equipment primitives can reach more than 80% by using the algorithm, and the error of connecting lines does not exceed 15%. By using the automatic conversion method, the workload of engineering personnel for manually drawing the flow chart can be avoided, and the production working efficiency of a factory is improved.
Drawings
Fig. 1 is a schematic flow chart of a general DCS process flow chart recognition and conversion method according to an embodiment of the present invention;
fig. 2 is a detailed flowchart of step S1 of a general DCS process flow diagram identification conversion method according to an embodiment of the present invention;
fig. 3 is a single-channel grayscale diagram of a general DCS process flow diagram identification conversion method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a specific step S12 of the identification and conversion method for a general DCS process flow chart according to an embodiment of the present invention;
fig. 5 is a binarized image of a general DCS process flow diagram identification conversion method provided by the embodiment of the present invention;
FIG. 6 is an image of a device of a general DCS process flow chart recognition conversion method according to an embodiment of the present invention;
FIG. 7 is a field image of a general DCS process flow chart recognition conversion method provided by the embodiment of the invention;
fig. 8 is a schematic specific flowchart of step S13 of the general DCS process flow chart recognition and conversion method according to the embodiment of the present invention;
fig. 9 is a schematic detailed flowchart of step S2 of the general DCS process flow chart recognition and conversion method according to the embodiment of the present invention;
fig. 10 is a schematic diagram of a character recognition result of the general DCS process flow chart recognition conversion method according to the embodiment of the present invention;
fig. 11 is a schematic diagram of character elimination of a general DCS process flow chart recognition conversion method according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a solid line detection result of a general DCS process flow diagram identification conversion method according to an embodiment of the present invention;
fig. 13 is a schematic diagram of a result obtained after solid line processing by the identification conversion method for the general DCS process flow diagram according to the embodiment of the present invention;
fig. 14 is a schematic detailed flowchart of step S2 of the general DCS process flow chart recognition and conversion method according to the embodiment of the present invention;
fig. 15 is a schematic diagram of a dotted line detection result of the identification and conversion method for the general DCS process flow diagram according to the embodiment of the present invention;
fig. 16 is a schematic specific flowchart of step S3 of the general DCS process flow chart recognition and conversion method according to the embodiment of the present invention;
fig. 17 is a schematic diagram of a contour detection result of a general DCS process flow diagram identification conversion method according to an embodiment of the present invention;
fig. 18 is a schematic diagram of a detection result of a data display control of the general DCS process flow diagram identification conversion method according to the embodiment of the present invention;
FIG. 19 is a schematic diagram of a detected solid line set of a general DCS process flow chart identification conversion method according to an embodiment of the present invention;
FIG. 20 is a converted flowchart of a general DCS process flow chart recognition conversion method according to an embodiment of the present invention;
fig. 21 is a schematic overall flow chart of the identification and conversion method for the general DCS process flow chart according to the embodiment of the present invention.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
Before this, in order to facilitate understanding of the technical solutions provided in the present application, some concepts are introduced below.
Machine vision: is a branch of the rapid development of artificial intelligence. Machine vision is to use a machine to replace human eyes for measurement and judgment. The machine vision system converts the shot target into image signals through a machine vision product, transmits the image signals to a special image processing system to obtain the form information of the shot target, and converts the form information into digital signals according to the information of pixel distribution, brightness, color and the like. The image system performs various calculations on these signals to extract the features of the target, and then controls the operation of the on-site equipment according to the result of the discrimination.
DCS: the DCS (Distributed Control System) System is a multi-level Computer System composed of a process Control level and a process monitoring level and using a Communication network as a link, and integrates Computer (Computer), communication (Communication), display (CRT), control (Control) and other technologies. The DCS system mainly includes an on-site control station (I/O station), a data communication system, a human-machine interface unit (operator station OPS, engineer station ENS), a cabinet, and a power supply. The system has an open architecture and can provide a multi-layer open data interface.
Graying of an image: in the RGB model, if R = G = B, the color represents a gray color, where the value of R = G = B is called a gray value, and each pixel of the gray image only needs one byte to store the gray value (also called an intensity value and a brightness value), and the gray range is 0-255.
Image binarization: the gray value of the pixel point on the image is set to 0 or 255, so that the whole image has obvious black and white effect.
Image filtering: the method is characterized in that the noise of the target image is suppressed under the condition of keeping the detailed characteristics of the image as much as possible, and the suppression is an indispensable operation in the image preprocessing, and the effectiveness and the reliability of the subsequent image processing and analysis are directly influenced by the quality of the processing effect.
Morphological treatment: a technique for analyzing images by computer to achieve desired results using basic operations of mathematical morphology. The most common basic operations are seven, which are: erosion, dilation, opening operations, closing operations, hits, refinement, and coarsening.
K-Means: the Kmeans clustering algorithm is an unsupervised clustering algorithm. The main role of the algorithm is to automatically classify similar samples into a class. So-called supervised algorithms, are input samples without corresponding outputs or labels. Clustering attempts to divide the samples in a data set into several usually disjoint subsets, each called a "cluster", as a separate process for finding the inherent distribution structure of the data, and as a process for proceeding to other learning tasks such as classification.
Hough transform: it is a feature extraction algorithm widely used in image analysis, computer vision and digital image processing. The hough transform is used to identify features in the object, such as: a line. The algorithm flow is generally as follows, given an object, the kind of shape to be identified, the algorithm performs a vote in the parameter space to determine the shape of the object, which is determined by the local maxima in the accumulation space.
Canny edge detection: is a multi-step algorithm for detecting edges in any input image. The following steps can be divided.
As shown in fig. 1, the method for identifying and converting a general DCS process flow diagram provided by the embodiment of the present invention includes: firstly, carrying out a preprocessing process including graying, binaryzation, filtering and morphological processing on an obtained process flow chart to obtain a separated equipment image and a field image; secondly, identifying characters and line segments in the character segment image to obtain character information and line segment information, and identifying an equipment outline in the equipment image to obtain equipment information; then, screening out effective equipment connection lines according to the equipment information and the line segment information; and finally, redrawing the flow chart based on the text information, the equipment information and the effective equipment connection line.
The invention provides a universal processing mode, which can effectively convert process flow charts on different DCS systems, the identification accuracy rate of equipment primitives can reach more than 80% by using the algorithm, and the error of connecting lines does not exceed 15%. By using the automatic conversion method, the workload of engineering personnel for manually drawing the flow chart can be avoided, and the production working efficiency of a factory is improved.
For a better understanding of the above-described technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Specifically, an embodiment of the present invention provides a method for identifying and converting a general DCS process flow diagram, including:
s1, carrying out a preprocessing process including graying, binaryzation, filtering and morphological processing on the acquired process flow diagram to obtain a separated equipment image and a field image.
As shown in fig. 2, step S1 includes:
s11, the acquired process flow chart is converted into a single-channel gray-scale chart shown in fig. 3, and the acquired image is converted into the single-channel gray-scale chart in order to reduce the amount of data to be processed.
And S12, carrying out binarization processing on the single-channel gray-scale image according to the background mask image generated by the K-Means clustering algorithm.
As shown in fig. 4, step S12 includes:
and S121, establishing a sample data set based on the acquired process flow diagram.
And S122, clustering all sample points in the sample data set by adopting a K-Means algorithm so as to segment the background of the process flow diagram.
S123, any edge pixel point belonging to the background is obtained, and the pixel point belonging to the same class label is found out according to the class label of the pixel point.
And S124, generating a background mask image based on all the found pixel points of the same category, and carrying out binarization processing on the gray-scale image according to the mask image.
Separating the background and the foreground by using a K-Means clustering algorithm, and mainly comprising the following steps:
1. reading in the flow chart image and establishing a sample data set.
2. And clustering points in the image by using a K-Means algorithm, and designating the clustering number to ensure that the background can be completely segmented.
3. And (4) taking an image edge pixel point, considering the pixel point to belong to the background part of the certificate photo, and acquiring a class label to which the pixel point belongs, thereby finding out the pixel point belonging to the same class label.
4. A background mask image is generated, and binarization processing is performed on the grayscale image according to the mask image, so that a binarized image shown in fig. 5 is finally obtained.
And S13, performing median filtering on the binarized image, and performing morphological operation to separate a device image containing a plurality of devices as shown in FIG. 6 and a field image containing characters and line segments as shown in FIG. 7.
As shown in fig. 8, step S13 includes:
and S131, performing convolution processing on the 3 x 3 filter kernel to filter the binarized image.
S132, performing closing operation on the filtered image to obtain an equipment image only reserving a plurality of equipment.
And S133, subtracting the image of the binarized image from the image of the equipment image to obtain a field image only retaining characters and line segments.
After median filtering is carried out on the binarized image, morphological operation is carried out on the image to separate character lines and equipment, and the specific process is as follows:
1. and taking 3-by-3 filtering checks to perform convolution processing on the image so as to achieve the filtering effect.
2. And performing closing operation on the filtered image to obtain an image with characters and lines eliminated.
3. And subtracting the original image from the image after the closing operation to obtain the image of the characters and the lines.
And S2, identifying the characters and the line segments in the field image to obtain character information and line segment information, and repairing the line segments with broken lines.
As shown in fig. 9, step S2 includes:
s21a, performing OCR character recognition on the binarized image, and eliminating characters in the field image according to the character recognition result of the figure 10 to obtain the image which only retains line segments and is shown in figure 11.
S22a, performing preliminary detection on the solid line of the field image with only the line segments left by hough transform detection, and obtaining a solid line detection result as shown in fig. 12.
Further, using hough transform to detect the solid line in the graph, the specific process is as follows:
1. canny edge detection and binarization are carried out on the image, and data points are determined by finding coordinates of non-zero points.
2. And carrying out Hough transformation on the data points, and mapping the data points to Hough space.
3. And gridding the Hough space, accumulating the intersection points of n solid lines, and changing the point value to be n.
4. Extreme points are found whose coordinates are the slope and intercept of the solid line in the image.
And S23a, traversing all the solid lines obtained by the primary detection, and classifying the solid lines with the distance smaller than 3 into the same class.
As shown in fig. 12, it can be seen that there are many overlapped solid lines after the preliminary detection, and there is a broken line between the solid lines, and at this time, the solid lines need to be further processed, which includes the following steps:
1. and traversing all solid lines, finding the solid lines with the distance less than 3, and classifying the solid lines into the same class.
2. Solid lines in the same class are sorted by coordinate.
3. And (4) sequentially calculating the spacing of the solid lines after sorting, and merging the solid lines with the distance smaller than 3 into one solid line.
And S24a, after sorting the solid lines in the same class according to coordinates, calculating the solid line spacing according to the sorting order, and merging the solid lines with the solid line spacing smaller than 3 into one solid line to finally obtain the image shown in FIG. 13. Fig. 13 shows less burrs at the edges of the lines and is smoother than fig. 12.
As shown in fig. 14, the method further includes, after step S24 a:
f241a, eliminating the solid line in the field image where only the line segment is retained, based on the obtained solid line of the preliminary detection.
F242a, performing an on operation on the field image of only the remaining line segment from which the solid line is eliminated, so that the dotted lines are connected.
F243a, the field image of the reserved line segment after the switch-on operation is subjected to solid line detection again, and further processing is carried out to screen out repeated solid lines.
F244a, traversing all the dotted lines, and classifying the dotted lines with the distance less than 3 between the dotted lines into the same class.
F245a, after the dotted lines in the same class are sorted according to the coordinates, the dotted line spacing is calculated according to the sorting sequence, and the dotted lines with the dotted line spacing smaller than 3 are combined into a dotted line.
The lines of different characteristics are represented differently in the flow charts, for example, a solid line represents a line connected to an actual apparatus (e.g., a rectifying tower in a chemical flow chart), a broken line represents a line connected to a measuring instrument (e.g., a pressure sensor), and the line at the lower layer is displayed in a broken line manner when the two lines cross.
The above step is a process of individually detecting the dashed lines in view that many dashed lines are not detected in the image after the detection of the solid line is completed, and may specifically include the following processes: (1) according to the solid line detection result, the solid line in the figure is eliminated. (2) The image is turned on so that the dotted lines are connected. (3) The image is subjected to dotted line detection, repeated dotted lines are further processed and screened, the processing method is the same as the solid line processing method, and the image shown in fig. 15 is finally obtained.
Meanwhile, step S2 further includes: and identifying the device outline in the device image to obtain device information.
As shown in fig. 16, step S3 includes:
and S21b, canny edge detection and binarization are carried out on each device of the device image.
And S22b, obtaining the connected domain of each device according to calculation, and obtaining the outline of each device.
S23b, calculating the area and the perimeter of the outline of each device, and screening out noise points smaller than a preset threshold value.
And S24b, traversing the screened outlines of the devices to obtain the area of the outline of each device and the length and the width of the circumscribed rectangle.
And S25b, judging whether the outline is rectangular according to the ratio of multiplying the area by the length and the width.
And S26b-1, if the rectangular shape is not adopted, determining that the device is an application device.
And S26b-2, if the outline is rectangular, judging that the outline is application equipment when no character information exists around and/or in the rectangle.
And S26b-3, if the outline is a rectangle, judging that the outline is a data display control when text information exists around and/or in the rectangle.
Wherein, the application equipment refers to equipment in practical application, such as reaction equipment in the chemical industry field, lines in a flow chart generally represent pipelines, and the edge profile of the application equipment is an irregular figure; the data display control is generally a device connected to the meter for displaying data of the meter, the edge contour of the data display control is rectangular, and text information exists around and/or inside the data display control, and the text information comprises position number information.
After all the line detection is finished, performing contour detection on the device image shown in fig. 7 to finally obtain a contour detection result shown in fig. 17, specifically including the following steps:
1. and (5) carrying out canny edge detection and binarization on the image.
2. And calculating an image connected domain and acquiring an image outer contour.
3. And calculating the outline area and the perimeter, and screening out noise points with smaller values.
After the contour detection finishes, need equipment and data display control in the discernment image, the characteristic of equipment is that the edge profile is mostly irregular figure, and the characteristic of data display control is that the edge profile is the rectangle and has the characters to represent the bit number information on every side, and the data display frame is interior to have the value to represent current bit number value, draws the data display control according to above characteristic, and concrete process is as follows:
1. and traversing the contour, and calculating the area of the contour and the length and the width of the circumscribed rectangle.
2. And judging whether the outline is rectangular or not according to the ratio of multiplying the area by the length and the width.
3. According to whether the bit number information exists around the rectangle or not and whether the bit number value exists inside the rectangle or not, whether the outline is a data display control or not is judged, and finally the data display control detection result shown in fig. 18 is obtained.
And S3, screening out effective equipment connection lines according to the equipment information and the line segment information.
The significance of processing lines is to improve the recognition accuracy of the original flow chart, characters in the original flow chart and line segments in the image can interfere the detection of the connection lines between the equipment in the flow chart, and the connection lines between the equipment are industrially significant, for example, in a chemical flow chart, the connection lines between the equipment represent the circulation of material flows, and the connection lines between the equipment are necessarily a complete flow chart, so that meaningless connection lines can be screened out through the relationship between the equipment and the connection lines.
Therefore, in view of the fact that the text detection cannot detect all the texts in the image in percentage, the undetected texts may interfere with the line segment detection, and at this time, the effective device connection information needs to be calculated by screening according to the line segment information and the device information, and the specific process is as follows:
1. all the solid lines are grouped, and the connected solid lines are grouped into one group.
2. And traversing all solid line groups to find the outer end points of all solid lines.
3. And traversing all the endpoints, judging whether the endpoints have equipment connected with the endpoints, and if not, deleting the solid line of the endpoint. Fig. 19 is a detected plurality of solid line groups.
The same operations as described above are also performed for the dotted lines.
And S4, redrawing the flow chart based on the character information, the equipment information and the effective equipment connection line to obtain the converted flow chart shown in the graph 20.
In addition, the invention also provides a general DCS process flow chart identifying and converting system, which comprises:
the image separation module is used for carrying out preprocessing processes including graying, binaryzation, filtering and morphological processing on the acquired process flow diagram to obtain a separated equipment image and a separated field image;
the identification module is used for identifying characters and line segments in the field image to obtain character information and line segment information, and identifying the equipment outline in the equipment image to obtain equipment information;
the screening module is used for screening out effective equipment connecting lines according to the equipment information and the line segment information;
and the redrawing module is used for redrawing the flow chart based on the text information, the equipment information and the effective equipment connection line.
Furthermore, the present invention also provides a computer readable medium having stored thereon computer executable instructions, which when executed by a processor, implement a general DCS process flow diagram identification conversion method as described above.
In summary, the present invention discloses a method, a system and a medium for identifying and converting a general DCS process flow diagram, as shown in fig. 21, the present invention first performs a preprocessing process including graying, binarization, filtering and morphological processing on an input flow diagram to obtain a device image and a field image which are obtained by segmentation; then, extracting features of the field image and the equipment image, and recognizing characters and/or lines of the field image; and finally, comprehensively obtaining information and redrawing the flow chart.
The invention provides a set of general identification and automatic drawing processes for different DCS system process flow charts, which comprises an image processing sequence, a method for dividing equipment graphic elements on different systems, an identification method for data display controls and a screening and verification processing method for detected connecting lines and equipment. The invention fills up the blank of the related technology in the field, and provides a process flow chart recognition and conversion method, which carries out image recognition and redrawing on the process flow chart, so that DCS flow charts on different operating systems can be compatible.
Since the system/apparatus described in the above embodiments of the present invention is a system/apparatus used for implementing the method of the above embodiments of the present invention, a person skilled in the art can understand the specific structure and modification of the system/apparatus based on the method described in the above embodiments of the present invention, and thus the detailed description is omitted here. All systems/devices adopted by the methods of the above embodiments of the present invention are within the intended scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the terms first, second, third and the like are for convenience only and do not denote any order. These words are to be understood as part of the name of the component.
Furthermore, it should be noted that in the description of the present specification, the description of the term "one embodiment", "some embodiments", "examples", "specific examples" or "some examples", etc., means that a specific feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, the claims should be construed to include preferred embodiments and all changes and modifications that fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include such modifications and variations.

Claims (10)

1. A general DCS process flow chart identification and conversion method is characterized by comprising the following steps:
carrying out a preprocessing process comprising graying, binaryzation, filtering and morphological processing on the obtained process flow diagram to obtain a separated equipment image and a separated field image;
recognizing characters and line segments in the field image to obtain character information and line segment information, and recognizing the equipment outline in the equipment image to obtain equipment information;
screening out effective equipment connecting lines according to the equipment information and the line segment information;
and redrawing a flow chart based on the text information, the equipment information and the effective equipment connection line.
2. The method of claim 1, wherein the step of subjecting the acquired process flow diagram to a pre-processing procedure comprising graying, binarization, filtering and morphological processing to obtain the separated device image and field image comprises:
converting the obtained process flow diagram into a single-channel grey-scale diagram;
carrying out binarization processing on the single-channel grey-scale image according to a background mask image generated by a K-Means clustering algorithm;
and carrying out median filtering on the binarized image, and then carrying out morphological operation to separate a field image containing characters and line segments and an equipment image containing a plurality of equipment.
3. The method of claim 2, wherein binarizing the single-channel gray-scale map based on the background mask image generated by the K-Means clustering algorithm comprises:
establishing a sample data set based on the acquired process flow diagram;
clustering all sample points in the sample data set by adopting a K-Means algorithm so as to segment the background of the process flow chart;
acquiring any edge pixel point belonging to the background, and finding out the pixel points belonging to the same category label according to the category label of the pixel point;
and generating a background mask image based on all the found pixel points of the same category, and carrying out binarization processing on the gray-scale image according to the mask image.
4. The method of claim 2, wherein the step of performing median filtering on the binarized image and performing morphological operations to separate a field image containing text and line segments and a device image containing a plurality of devices comprises:
performing convolution processing on the 3 x 3 filtering kernel to filter the binarized image;
performing closed operation on the filtered image to obtain an equipment image only reserving a plurality of equipment;
and subtracting the image of the equipment image from the binarized image to obtain a field image only retaining characters and line segments.
5. The method of claim 2, wherein identifying the text and line segments in the field image to obtain text information and line segment information comprises:
performing OCR character recognition on the binarized image, eliminating characters in the field image according to a character recognition result, and only keeping line segments;
performing preliminary detection on a solid line of a field image only keeping line segments through Hough transform detection;
traversing all the solid lines obtained by the primary detection, and classifying the solid lines with the distance smaller than 3 into the same class;
after sorting the solid lines in the same class according to the coordinates, calculating the solid line spacing according to the sorting order, and merging the solid lines with the solid line spacing smaller than 3 into one line.
6. The method of claim 5, wherein after sorting the solid lines in the same class by coordinates, calculating the solid line spacing in the sorting order, and merging the solid lines with the solid line spacing less than 3 into one line, the method further comprises:
eliminating the solid line in the field image of the reserved line segment only according to the solid line obtained by the preliminary detection;
opening the field image of the only reserved line segment with the solid line eliminated so as to connect the dotted lines;
performing solid line detection again on the field image of the reserved line segment after the opening operation, and further processing to screen out repeated solid lines;
traversing all the dotted lines, and classifying the dotted lines with the distance smaller than 3 into the same class;
after the dotted lines in the same class are sorted according to the coordinates, the dotted line spacing is calculated according to the sorting order, and the dotted lines with the dotted line spacing smaller than 3 are combined into a dotted line.
7. The method of claim 6, wherein identifying the device profile in the device image to obtain device information comprises:
performing canny edge detection and binarization on each device of the device image;
obtaining a connected domain of each device according to calculation to obtain the outline of each device;
calculating the area and the perimeter of the outline of each device, and screening out noise points smaller than a preset threshold value;
traversing the outlines of the screened devices to obtain the area of the outline of each device and the length and width of the circumscribed rectangle;
judging whether the outline is rectangular according to the ratio of multiplying the area by the length and the width;
if the current time is not the rectangle, the current time is judged to be the application equipment;
if the contour is a rectangle, judging the contour to be application equipment when text information does not exist around and/or in the rectangle;
if the outline is a rectangle, judging that the outline is a data display control when text information exists around and/or inside the rectangle;
the application device is characterized in that the edge outline of the application device is an irregular graph, the edge outline of the data display control is rectangular, text information exists around and/or inside the data display control, and the text information comprises position number information.
8. The method of claim 7, wherein screening the active device connections according to the device information and the line information comprises:
grouping all the solid lines, and grouping the connected solid lines into one group;
traversing all solid line groups to find out the outer end points of all solid lines;
traversing all outer end points of the solid line, judging whether the outer end points are connected with the equipment or not, and if not, deleting the solid line of the end point;
and the number of the first and second groups,
grouping all the broken lines, and grouping the connected broken lines into a group;
traversing all the virtual line groups, and finding out the outer end points of all the virtual lines;
and traversing all the outer end points of the dotted line, judging whether the outer end points have the equipment connected with the outer end points, and if not, deleting the solid lines of the end points.
9. A general DCS process flow chart recognition and conversion system is characterized by comprising:
the image separation module is used for carrying out preprocessing processes including graying, binaryzation, filtering and morphological processing on the acquired process flow diagram to obtain a separated equipment image and a separated field image;
the identification module is used for identifying characters and line segments in the field image to obtain character information and line segment information, and identifying the equipment outline in the equipment image to obtain equipment information;
the screening module is used for screening out effective equipment connecting lines according to the equipment information and the line segment information;
and the redrawing module is used for redrawing the flow chart based on the text information, the equipment information and the effective equipment connection line.
10. A computer readable medium having stored thereon computer executable instructions, which when executed by a processor, implement a universal DCS process flow chart recognition conversion method as claimed in any one of claims 1-8.
CN202211027308.6A 2022-08-25 2022-08-25 Universal DCS process flow chart identification conversion method, system and medium Pending CN115393589A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211027308.6A CN115393589A (en) 2022-08-25 2022-08-25 Universal DCS process flow chart identification conversion method, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211027308.6A CN115393589A (en) 2022-08-25 2022-08-25 Universal DCS process flow chart identification conversion method, system and medium

Publications (1)

Publication Number Publication Date
CN115393589A true CN115393589A (en) 2022-11-25

Family

ID=84121875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211027308.6A Pending CN115393589A (en) 2022-08-25 2022-08-25 Universal DCS process flow chart identification conversion method, system and medium

Country Status (1)

Country Link
CN (1) CN115393589A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115995091A (en) * 2023-02-09 2023-04-21 清华大学 Method and device for reading flow chart, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115995091A (en) * 2023-02-09 2023-04-21 清华大学 Method and device for reading flow chart, electronic equipment and storage medium
CN115995091B (en) * 2023-02-09 2023-08-25 清华大学 Method and device for reading flow chart, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109816644B (en) Bearing defect automatic detection system based on multi-angle light source image
JP7113657B2 (en) Information processing device, information processing method, and program
CN110334706B (en) Image target identification method and device
CN111079747B (en) Railway wagon bogie side frame fracture fault image identification method
CN115082683B (en) Injection molding defect detection method based on image processing
CN109377485B (en) Machine vision detection method for instant noodle packaging defects
Kahraman et al. License plate character segmentation based on the gabor transform and vector quantization
CN110717896B (en) Plate strip steel surface defect detection method based on significance tag information propagation model
CN109523529B (en) Power transmission line defect identification method based on SURF algorithm
CN106709524B (en) Element symbol detection and identification method in electrical engineering drawing
CN111652213A (en) Ship water gauge reading identification method based on deep learning
CN114820625B (en) Automobile top block defect detection method
CN112307919B (en) Improved YOLOv 3-based digital information area identification method in document image
CN111539330B (en) Transformer substation digital display instrument identification method based on double-SVM multi-classifier
CN114511770A (en) Road sign plate identification method
CN115393589A (en) Universal DCS process flow chart identification conversion method, system and medium
CN109271882B (en) Method for extracting color-distinguished handwritten Chinese characters
Fang et al. Towards real-time crack detection using a deep neural network with a Bayesian fusion algorithm
CN111767909B (en) Character recognition method and device and computer readable storage medium
CN111860500A (en) Shoe print wear area detection and edge tracing method
Chiang et al. A method for automatically extracting road layers from raster maps
CN115880566A (en) Intelligent marking system based on visual analysis
Guo et al. Fault diagnosis of power equipment based on infrared image analysis
CN112801963B (en) Video image occlusion detection method and system
CN114529906A (en) Method and system for detecting abnormity of digital instrument of power transmission equipment based on character recognition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination