CN107622245B - Paper waveform extraction method and device - Google Patents
Paper waveform extraction method and device Download PDFInfo
- Publication number
- CN107622245B CN107622245B CN201710879627.2A CN201710879627A CN107622245B CN 107622245 B CN107622245 B CN 107622245B CN 201710879627 A CN201710879627 A CN 201710879627A CN 107622245 B CN107622245 B CN 107622245B
- Authority
- CN
- China
- Prior art keywords
- waveform
- region
- lead
- connected region
- target
- 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.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention provides a paper waveform extraction method and a device, the method separates the waveform and the character area in an electrocardiogram report by a threshold value method, obtains a complete lead waveform area by a projection contour method, and then divides the lead waveform into a plurality of sub-areas, when the lead waveform pixel of the sub-areas is not lost, the lead waveform can be obviously distinguished from a lead symbol and a lead separator by the characteristic of the maximum pixel number of a lead waveform communication area, and the lead waveform can be extracted at one time without positioning the projection threshold value; when the waveform areas of the sub-areas are not communicated, the communicated areas in the sub-areas are subjected to distance comparison by a distance judgment method, the communicated areas which are closest in distance and belong to the waveform areas are screened out and merged end to generate a communicated waveform area, and therefore the lead waveforms are extracted. The problem that a part of special waveforms can not be accurately extracted by a traditional threshold projection method can be solved.
Description
Technical Field
The invention relates to the field of data processing, in particular to a paper waveform extraction method and device.
Background
The electrocardiogram is an important examination means for diagnosing heart diseases, most of electrocardiogram reports are recorded by thermal printing paper, and due to the chemical characteristics and storage conditions of the thermal printing paper, the color of a printing curve becomes light, the quality of pictures becomes poor, and even paper is damaged, so that typical clinical electrocardiogram signals cannot be stored for a long time. If the reserved ECG paper file report is converted into a picture through a laser printer or a digital camera, the waveform data in the picture is extracted through an image processing technology, the waveform curve in the picture is digitized and then filed in a certain format, so that the management of a hospital on patient information and the teaching and scientific research of a clinician are facilitated, the physician can also utilize a large amount of obtained data to carry out more refined quantitative statistical analysis and diagnosis on the heart disease, more and more accurate clinical diagnosis standards are developed, and the accuracy of patient disease diagnosis is improved.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a paper waveform extraction method and apparatus, which can digitize paper waveform data.
In a first aspect, an embodiment of the present invention provides a paper waveform extraction method, where the method includes: acquiring data of an electrocardiogram report graph, and separating a background grid region included in the electrocardiogram report graph based on a threshold value method to obtain a waveform and a character region; based on a projection contour method, acquiring the positions of the upper, lower, left and right boundaries of the lead waveform in the waveform and character region, and extracting the complete lead waveform; dividing the lead waveform into a plurality of sub-areas according to the upper, lower, left and right boundary positions and the printing layout included in the electrocardiogram report chart; marking each sub-region with a connected region, and acquiring a first connected region representing waveforms and a second connected region representing lead separators and lead symbols in each sub-region; calculating the distance between each second communication area and the first communication area, and deleting the second communication areas with the distance larger than a preset value to obtain a second target communication area; judging whether the second target connected region is a lead separator; if not, combining the first communication area and the second communication area to obtain a first target communication area; and extracting the first target connected region in each sub-region to obtain waveform data.
In a second aspect, an embodiment of the present invention provides a paper waveform extraction apparatus, where the apparatus includes: the first acquisition module is used for acquiring data of the electrocardio report graph, and separating a background grid region included in the electrocardio report graph based on a threshold value method to obtain a waveform and a character region; the projection module is used for acquiring the positions of the upper, lower, left and right boundaries of the lead waveform in the waveform and character region based on a projection contour method and extracting the complete lead waveform; the segmentation module is used for segmenting the lead waveform into a plurality of sub-regions according to the upper, lower, left and right boundary positions and the printing layout included by the electrocardiogram report chart; a second obtaining module, configured to perform connected component labeling on each sub-region, and obtain a first connected component characterizing waveforms and a second connected component characterizing lead separators and lead symbols in each sub-region; the deleting module is used for calculating the distance between each second communication area and the first communication area, and deleting the second communication areas with the distance larger than a preset value to obtain second target communication areas; the judging module is used for judging whether the second target connected region is a lead separator; the judgment execution module is used for merging the first communication area and the second communication area to obtain a first target communication area when the judgment module judges that the first communication area is not the second communication area; and the extraction module is used for extracting the first target connected region in each sub-region to obtain waveform data.
Compared with the prior art, the paper waveform extraction method and the paper waveform extraction device provided by the embodiments of the invention have the beneficial effects that: the method comprises the steps of separating waveform and character areas in an electrocardio report graph by a threshold method, obtaining a complete lead waveform area by a projection contour method, dividing a lead waveform into a plurality of sub-areas according to an electrocardio signal shift printing layout, and according to a connected area marking principle, under the condition that lead waveform pixels of the sub-areas are not lost, obviously distinguishing the lead waveform from lead symbols and lead separators by the characteristic that the number of the pixels of the connected area of the lead waveform is the largest, and extracting the lead waveform at one time without positioning a projection threshold; when the waveform areas of the sub-areas are not communicated, the communicated areas in the sub-areas are subjected to distance comparison by a distance judgment method, the communicated areas which are closest in distance and belong to the waveform areas are screened out and merged end to generate a communicated waveform area, and therefore the lead waveforms are extracted. The method can solve the problem that the traditional threshold projection method cannot accurately extract part of special waveforms (such as pixel loss and waveform fracture).
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of a user terminal according to an embodiment of the present invention;
fig. 2 is a flowchart of a paper waveform extraction method according to a first embodiment of the present invention;
FIG. 3 is a flow chart of another paper waveform extraction method according to the first embodiment of the present invention;
fig. 4 is a block diagram of a paper waveform extracting apparatus according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, is a block diagram of a user terminal 100. The user terminal 100 may be a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), or the like.
The user terminal 100 includes: the device comprises a paper waveform extraction device, a memory 110, a storage controller 120, a processor 130, a peripheral interface 140, an input and output unit 150, an audio unit 160 and a display unit 170.
The memory 110, the memory controller 120, the processor 130, the peripheral interface 140, the input/output unit 150, the audio unit 160, and the display unit 170 are electrically connected to each other directly or indirectly, so as to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The paper waveform extracting device includes at least one software functional module which can be stored in the memory 110 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the client device. The processor 130 is configured to execute an executable module stored in the memory 110, such as a software functional module or a computer program included in the paper waveform extraction device.
The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 110 is used for storing a program, and the processor 130 executes the program after receiving an execution instruction, and the method defined by the flow disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 130, or implemented by the processor 130.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The peripheral interface 140 couples various input/output devices to the processor 130 and to the memory 110. In some embodiments, peripheral interface 140, processor 130, and memory controller 120 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The input and output unit 150 is used for providing input data to the user to realize the user interaction with the user terminal 100. The input/output unit 150 may be, but is not limited to, a mouse, a keyboard, and the like.
The display unit 170 provides an interactive interface (e.g., a user operation interface) between the user terminal 100 and the user or is used to display image data to the user reference. In this embodiment, the display unit 170 may be a liquid crystal display or a touch display. In the case of a touch display, the display can be a capacitive touch screen or a resistive touch screen, which supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations from one or more locations on the touch display at the same time, and the sensed touch operations are sent to the processor 130 for calculation and processing.
First embodiment
Referring to fig. 2, fig. 2 is a flowchart of a paper waveform extraction method according to a first embodiment of the present invention, where the method is applied to a client. The flow shown in fig. 2 will be described in detail below, and the method includes:
step S110: acquiring data of the electrocardiogram report graph, and separating a background grid region included in the electrocardiogram report graph based on a threshold value method to obtain a waveform and a character region.
Because the thermosensitive printing paper of the electrocardiogram report is all light red background grids, printed curves and characters are black, the picture for printing the report is a color picture, according to the RGB composite color image principle, the thresholds of the light red background grids and the black curves of the light red background grids are obviously different at R, G, B layers of pictures, the grids and the curve characters are separated according to the threshold offset, a black and white picture only with the curves and the characters is generated, the curves and the characters are white, the gray scale is 255, the background is processed into black, and the gray scale is 0. Because the resolution of the image is different from that of the laser printer, only the pictures of the curve and the characters may have scattered noise signals, and in order to obtain a clean and complete curve, the pictures are subjected to median filtering to remove noise interference, so that a waveform and a character area can be obtained.
Step S120: and acquiring the positions of the upper, lower, left and right boundaries of the lead waveform in the waveform and character regions based on a projection contour method, and extracting the complete lead waveform.
Wherein the lead waveforms are typically 12 lead waveforms.
Because interval gaps exist between characters and waveforms in the electrocardiogram report and are distributed in a rectangular mode, a rectangular coordinate system can be established in the waveforms and the character area, then a projection contour method is adopted, the Y axis is projected to, the pixel summation in the projection direction is calculated, the pixel summation after the current line is projected is 0, the pixel summation in the next line is greater than 0, the line position is indicated to be a blank boundary area, and the upper boundary and the lower boundary of the whole area of the waveform signals in the waveforms and the character area are found through the characteristic. Similarly, the sum of the pixels in the projection direction can be calculated according to the projected X-axis, the sum of the pixels after projection in the current row is 0, the sum of the pixels in the next column is greater than 0, which indicates that the position of the column is a blank boundary area, and the left boundary (left _ start _ point) and the right boundary (right _ end _ point) of the whole area of the waveform signal in the waveform and text areas are found through the characteristic. The left border represents the starting coordinates of the pixel on the X-axis and the right border represents the ending coordinates of the pixel on the X-axis.
The client can extract the complete lead waveform based on the upper, lower, left and right boundaries of the waveform signal.
Step S130: and dividing the lead waveform into a plurality of sub-areas according to the upper, lower, left and right boundary positions and the printing layout included in the electrocardiogram report chart.
The manufacturers of each electrocardiograph adopt matrix type block printing processing when printing electrocardio reports, and the printing modes of the electrocardiograph are common: 3 x 4, 6 x 2, 12 x 1, and according to the rule of layout of the matrix, a scaling symbol is printed at the middle position of the leftmost side of the printed report or at the leftmost side of the beginning of each row of lead signals or at the rightmost side of each row of lead signals, and adjacent lead waveforms are separated by separators, usually as dashed or solid lines. The printing layout of the electrocardiogram report acquired by the client can represent the printing mode of the electrocardiograph.
In the case of 3 × 4, the lead area range in each row is approximated by the matrix square print layout characteristics and the left and right boundaries of the lead waveform as references: (right _ end _ position-left _ start _ position)/4, the range of lead waveforms for each row is partitioned into 4 sub-regions. Similarly, in the case of 6 × 2, the range of each row of lead region is: (right _ end _ position-left _ start _ position)/2, each row of the lead waveform is partitioned into 2 sub-regions.
Each of the sub-regions contains 3 elements: lead waveforms, lead symbols, and lead separators, these three elements being completely spatially separated, independent connected regions.
Step S140: and marking the connected regions of each sub-region, and acquiring a first connected region which is used for representing the waveform and a second connected region which is used for representing the lead separator and the lead symbol in each sub-region.
In a set, elements that are connected to each other form a region, while points that are not connected form a different region. The set of all the points connected with each other is called a connected region, and the connected region mark is used for distinguishing the elements belonging to different connected regions in one set.
Connected component labeling may be performed for each of the sub-regions to obtain a plurality of connected components, such as a lead waveform connected component, a lead symbol connected component, and a lead separator connected component, and horizontal and vertical coordinate values of pixels of the sub-regions are stored in each connected component subset.
Since lead symbols are composed of letters, such as I, aVR, aVL, V1, V3, etc., they may be labeled as 1 connected region (e.g., I), and lead symbols like the left and right structures (e.g., aVR, aVL, V1, V3 with unconnected pixels between adjacent letters) may be labeled as 2 different sets of connected regions. However, the lead waveform has the particularity of being continuous, and only 1 connected region will be marked in the case of a waveform with no break in pixel. According to the characteristic, the total number of pixel values of each connected region can be obtained; one connected-together region with the largest total number of pixel values is taken as a first connected-together region characterizing the waveform, and the remaining connected-together regions are taken as second connected-together regions characterizing the lead separators and lead symbols.
Since the background grid region may coincide with a part of the lead waveform, when the grid region is separated, a part of the lead waveform may be removed, and a part of the pixels of the first connected region may be lost, the curve may be broken, and the result may be incomplete. And a broken but not removed curve would be mistaken for a second connected region characterizing a lead separator or lead symbol. Therefore, it is necessary to restore the lost pixels and the broken pixels in the first communication area.
Step S150: and calculating the distance between each second communication area and the first communication area, and deleting the second communication areas with the distance larger than a preset value to obtain a second target communication area.
Further, positions of pixels of a start and an end of a second connected region and each of first connected regions may be extracted, and a distance between each of the second connected regions and the first connected region may be calculated. Since the pixel at the end position of the previous connected region is closest to the pixel at the start position of the next connected region in the two adjacent connected regions, the second connected region which is more than the preset distance value away from the first connected region can be regarded as the second connected region for representing the lead symbol. And deleting the second connected region representing the lead symbols in the second connected region to obtain a second target connected region. In this case, the second target connected region may be a lead separator or lead symbol or a broken lead waveform.
Step S160: determining whether the second target connected component region is a lead separator.
Because the lead separators are arranged at the left end and the right end of the sub-region, and the lead symbols are arranged at the upper left position of the sub-region, the abscissa range of each second target connected region can be obtained, the abscissa range is compared with a preset first preset range, whether the second target connected region is the lead separator or the lead symbol is judged, and the first preset range represents each left side boundary and right side boundary of the sub-region. And if the abscissa range is within the first preset range, judging that the second target connected region is a lead separator or a lead symbol. Otherwise, the second target connected component region is not a lead separator or lead symbol.
Step S170: if not, combining the first connected region and the second target connected region to obtain a first target connected region.
And if no lead separator or lead symbol exists in the second target connected region, combining the first connected region and the second connected region according to the shortest distance to obtain a first target connected region. Further, the head and tail pixels of the first connected region and the second target connected region may be set to 255, and the fractured regions may be connected to obtain the first target connected region.
Step S180: and extracting the first target connected region in each sub-region to obtain waveform data.
In addition, as an embodiment, please refer to fig. 3, the step S170 may further include:
step S171: and if so, deleting the second target connected region representing the lead separator or the lead symbol, and merging the first connected region and the rest second target connected region to obtain a first target connected region.
The method for extracting the paper waveform provided by the first embodiment of the invention has the beneficial effects that: the method comprises the steps of separating waveform and character areas in an electrocardio report graph by a threshold method, obtaining a complete lead waveform area by a projection contour method, dividing a lead waveform into a plurality of sub-areas according to an electrocardio signal shift printing layout, and according to a connected area marking principle, under the condition that lead waveform pixels of the sub-areas are not lost, obviously distinguishing the lead waveform from lead symbols and lead separators by the characteristic that the number of the pixels of the connected area of the lead waveform is the largest, and extracting the lead waveform at one time without positioning a projection threshold; when the waveform areas of the sub-areas are not communicated, the communicated areas in the sub-areas are subjected to distance comparison by a distance judgment method, the communicated areas which are closest in distance and belong to the waveform areas are screened out and merged end to generate a communicated waveform area, and therefore the lead waveforms are extracted. The method can solve the problem that the traditional threshold projection method cannot accurately extract part of special waveforms (such as pixel loss and waveform fracture).
Second embodiment
Referring to fig. 4, fig. 4 is a block diagram illustrating a paper waveform extracting apparatus 400 according to a second embodiment of the present invention. The block diagram of fig. 4 will be explained, and the apparatus shown comprises:
a first obtaining module 410, configured to obtain data of an electrocardiogram report, and separate a background grid region included in the electrocardiogram report based on a threshold method to obtain a waveform and a text region;
a projection module 420, configured to obtain the positions of the upper, lower, left, and right boundaries of the lead waveform in the waveform and text region based on a projection profile method, and extract a complete lead waveform;
a dividing module 430, configured to divide the lead waveform into a plurality of sub-regions according to the upper, lower, left, and right boundary positions and the printing layout included in the electrocardiographic report;
a second obtaining module 440, configured to perform connected component labeling on each sub-region, and obtain a first connected component characterizing waveforms and a second connected component characterizing lead separators or lead symbols in each sub-region;
a deleting module 450, configured to calculate a distance between each second connected region and the first connected region, and delete the second connected region whose distance is greater than a preset value, to obtain a second target connected region;
a judging module 460, configured to judge whether the second target connected region is a lead separator;
a determining executing module 470, configured to merge the first connected region and the second connected region to obtain a first target connected region when the determining module 460 determines that the first connected region is not the second connected region;
the extracting module 480 is configured to extract the first target connected region in each sub-region to obtain waveform data.
Further, the determination executing module 470 may be further configured to, when the determining module 460 determines yes, delete the second target connected region representing the lead separator, and merge the first connected region with the remaining second target connected regions to obtain a first target connected region.
In this embodiment, please refer to the contents described in the embodiments shown in fig. 1 to fig. 3 for the process of implementing each function of each functional module of the paper waveform extracting apparatus 400, which is not described herein again.
In summary, in the paper waveform extraction method and apparatus provided in the embodiments of the present invention, the waveform and the text region in the electrocardiographic report are first separated by a threshold method, then a complete lead waveform region is obtained by a projection contour method, and then the lead waveform is divided into a plurality of sub-regions according to the arrangement and printing layout of the electrocardiographic signals, according to the principle of marking the connected region, when the lead waveform pixels of the sub-regions are not lost, the lead waveform can be obviously distinguished from the lead symbols and the lead separators by the characteristic of the largest number of pixels in the connected region of the lead waveform, and the lead waveform can be extracted at one time without positioning the projection threshold; when the waveform areas of the sub-areas are not communicated, the communicated areas in the sub-areas are subjected to distance comparison by a distance judgment method, the communicated areas which are closest in distance and belong to the waveform areas are screened out and merged end to generate a communicated waveform area, and therefore the lead waveforms are extracted. The method can solve the problem that the traditional threshold projection method cannot accurately extract part of special waveforms (such as pixel loss and waveform fracture).
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (6)
1. A paper waveform extraction method, characterized in that the method comprises:
acquiring data of an electrocardiogram report graph, and separating a background grid region included in the electrocardiogram report graph based on a threshold value method to obtain a waveform and a character region;
based on a projection contour method, acquiring the positions of the upper, lower, left and right boundaries of the lead waveform in the waveform and character region, and extracting the complete lead waveform;
dividing the lead waveform into a plurality of sub-areas according to the upper, lower, left and right boundary positions and the printing layout included in the electrocardiogram report chart;
marking a connected region for each sub-region to obtain a plurality of connected regions;
acquiring the total number of pixel values of each connected region;
the connected regions with the total number of pixel values larger than a first preset value are used as first connected regions for representing waveforms, and the connected regions with the total number of pixel values smaller than a second preset value are used as second connected regions for representing lead separators or lead symbols;
calculating the distance between each second communication area and the first communication area, and deleting the second communication areas with the distance larger than a preset value to obtain a second target communication area;
acquiring the abscissa range of the second target connected region;
comparing the abscissa range with a preset first preset range to judge whether the second target connected region is a lead separator, wherein the first preset range represents the left side boundary and the right side boundary of each sub-region;
if not, combining the first connected region and the second target connected region to obtain a first target connected region;
and extracting the first target connected region in each sub-region to obtain electrocardiographic waveform data.
2. The method of claim 1, wherein the determining whether the second target connected component region is a lead separator further comprises:
and if so, deleting the second target connected region representing the lead separator, and merging the first connected region and the rest second target connected region to obtain a first target connected region.
3. The method of claim 1, wherein merging the first connected region with the second connected region to obtain a first target connected region comprises:
and setting head and tail pixels of the first connected region and the second target connected region to be 255 to obtain a first target connected region.
4. A paper waveform extraction device, the device comprising:
the first acquisition module is used for acquiring data of the electrocardio report graph, and separating a background grid region included in the electrocardio report graph based on a threshold value method to obtain a waveform and a character region;
the projection module is used for acquiring the positions of the upper, lower, left and right boundaries of the lead waveform in the waveform and character region based on a projection contour method and extracting the complete lead waveform;
the segmentation module is used for segmenting the lead waveform into a plurality of sub-regions according to the upper, lower, left and right boundary positions and the printing layout included by the electrocardiogram report chart;
the second acquisition module comprises a marking submodule, an acquisition submodule and a comparison submodule, wherein the marking submodule is used for marking each sub-region to obtain a plurality of connected regions; the obtaining submodule is used for obtaining the total number of pixel values of each connected region; the comparison submodule is used for taking the connected region with the total number of pixel values larger than a first preset value as a first connected region for representing a waveform, and taking the connected region with the total number of pixel values smaller than a second preset value as a second connected region for representing a lead separator and a lead symbol;
the deleting module is used for calculating the distance between each second communication area and the first communication area, and deleting the second communication areas with the distance larger than a preset value to obtain second target communication areas;
the judging module is used for acquiring the abscissa range of the second target connected region, comparing the abscissa range with a preset first preset range and judging whether the second target connected region is a lead separator or not, wherein the first preset range represents the left side boundary and the right side boundary of each sub-region;
the judgment execution module is used for merging the first communication area and the second communication area to obtain a first target communication area when the judgment module judges that the first communication area is not the second communication area;
and the extraction module is used for extracting the first target connected region in each sub-region to obtain electrocardiographic waveform data.
5. The apparatus according to claim 4, wherein the determination performing module is further configured to delete the second target connected region representing the lead separator and merge the first connected region with the remaining second target connected region to obtain a first target connected region when the determination module determines yes.
6. The apparatus according to claim 4, wherein the determination performing module is configured to set head and tail pixels of the first connected component and the second target connected component to 255, so as to obtain a first target connected component.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710879627.2A CN107622245B (en) | 2017-09-26 | 2017-09-26 | Paper waveform extraction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710879627.2A CN107622245B (en) | 2017-09-26 | 2017-09-26 | Paper waveform extraction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107622245A CN107622245A (en) | 2018-01-23 |
CN107622245B true CN107622245B (en) | 2020-02-07 |
Family
ID=61090867
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710879627.2A Active CN107622245B (en) | 2017-09-26 | 2017-09-26 | Paper waveform extraction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107622245B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111466905B (en) * | 2020-04-10 | 2021-01-22 | 西安交通大学 | Electrocardiographic waveform extraction method based on bidirectional communication |
CN113077472B (en) * | 2021-04-07 | 2023-02-10 | 华南理工大学 | Paper electrocardiogram curve image segmentation method, system, device and medium |
CN114663443A (en) * | 2022-02-24 | 2022-06-24 | 清华大学 | 12-lead paper electrocardiogram digitization method and device |
CN115517686A (en) * | 2022-11-24 | 2022-12-27 | 合肥心之声健康科技有限公司 | Family environment electrocardiogram image analysis method, device, equipment, medium and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102038498A (en) * | 2011-01-20 | 2011-05-04 | 天津理工大学 | Method for digitalizing paper electrocardiogram |
CN104318233A (en) * | 2014-10-19 | 2015-01-28 | 温州大学 | Method for horizontal tilt correction of number plate image |
CN104424629A (en) * | 2013-08-19 | 2015-03-18 | 深圳先进技术研究院 | X-ray chest radiography lung segmentation method and device |
CN105678299A (en) * | 2016-02-29 | 2016-06-15 | 江文得 | License plate positioning method |
CN107085726A (en) * | 2017-01-04 | 2017-08-22 | 安阳师范学院 | Oracle bone rubbing individual character localization method based on multi-method denoising and connected component analysis |
CN107174232A (en) * | 2017-04-26 | 2017-09-19 | 天津大学 | A kind of electrocardiographic wave extracting method |
-
2017
- 2017-09-26 CN CN201710879627.2A patent/CN107622245B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102038498A (en) * | 2011-01-20 | 2011-05-04 | 天津理工大学 | Method for digitalizing paper electrocardiogram |
CN104424629A (en) * | 2013-08-19 | 2015-03-18 | 深圳先进技术研究院 | X-ray chest radiography lung segmentation method and device |
CN104318233A (en) * | 2014-10-19 | 2015-01-28 | 温州大学 | Method for horizontal tilt correction of number plate image |
CN105678299A (en) * | 2016-02-29 | 2016-06-15 | 江文得 | License plate positioning method |
CN107085726A (en) * | 2017-01-04 | 2017-08-22 | 安阳师范学院 | Oracle bone rubbing individual character localization method based on multi-method denoising and connected component analysis |
CN107174232A (en) * | 2017-04-26 | 2017-09-19 | 天津大学 | A kind of electrocardiographic wave extracting method |
Non-Patent Citations (1)
Title |
---|
基于k-means的纸质心电图数字化信息提取研究;闫磊等;《河北工业科技》;20160731;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN107622245A (en) | 2018-01-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107622245B (en) | Paper waveform extraction method and device | |
US10878003B2 (en) | System and method for extracting structured information from implicit tables | |
JP6326847B2 (en) | Image processing apparatus, image processing method, and image processing program | |
US20180089835A1 (en) | Image processing apparatus for identifying region within image, information processing method, and storage medium | |
JP5600723B2 (en) | Method and system for splitting characters in a text line having various character widths | |
US20210192262A1 (en) | Apparatus for processing image, storage medium, and image processing method | |
CN111325725A (en) | Retina image recognition method and device, electronic equipment and storage medium | |
Wu et al. | A fully-automated paper ECG digitisation algorithm using deep learning | |
CN107625519B (en) | Electrocardiogram processing method and device | |
JP4393411B2 (en) | Image processing apparatus, image processing program, and image processing method | |
Ganesh et al. | Combining optical character recognition with paper ECG digitization | |
Shrivastava et al. | Digitization of ECG paper records using MATLAB | |
JP5601027B2 (en) | Image processing apparatus and image processing program | |
KR102150200B1 (en) | Apparatus for recognizing an image of diagnosis instrument having 7-segment | |
US9928451B2 (en) | Information processing apparatus, controlling method, and computer-readable storage medium | |
JP6546385B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND PROGRAM | |
CN115331013A (en) | Data extraction method and processing equipment for line graph | |
CN114663443A (en) | 12-lead paper electrocardiogram digitization method and device | |
KR20100088052A (en) | Image processing apparatus, image processing method and recording media | |
CN111127414B (en) | Perfusion image judgment system and method based on OPENCV and intelligent terminal | |
JP2017164068A (en) | Determination device, analysis device, calculation device, determination method, analysis method, calculation method, determination program, analysis program, and calculation program | |
CN111627511A (en) | Ophthalmologic report content identification method and device and readable storage medium | |
JP5246496B2 (en) | calculator | |
US20220406083A1 (en) | Image processing apparatus, control method thereof, and storage medium | |
JP7480997B2 (en) | Image processing device, image processing method, and program |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |