CN107625519B - Electrocardiogram processing method and device - Google Patents

Electrocardiogram processing method and device Download PDF

Info

Publication number
CN107625519B
CN107625519B CN201710870201.0A CN201710870201A CN107625519B CN 107625519 B CN107625519 B CN 107625519B CN 201710870201 A CN201710870201 A CN 201710870201A CN 107625519 B CN107625519 B CN 107625519B
Authority
CN
China
Prior art keywords
lead
image
waveform
curve
obtaining
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
Application number
CN201710870201.0A
Other languages
Chinese (zh)
Other versions
CN107625519A (en
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.)
Wuhan Zoncare Bio Medical Electronics Co ltd
Original Assignee
Wuhan Zoncare Bio Medical Electronics 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 Wuhan Zoncare Bio Medical Electronics Co ltd filed Critical Wuhan Zoncare Bio Medical Electronics Co ltd
Priority to CN201710870201.0A priority Critical patent/CN107625519B/en
Publication of CN107625519A publication Critical patent/CN107625519A/en
Application granted granted Critical
Publication of CN107625519B publication Critical patent/CN107625519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides an electrocardiogram processing method and device, and relates to the technical field of image processing. The method comprises the steps of performing separation processing on the read paper electrocardiogram image to obtain a lead curve area image; separating the lead curve region image into a plurality of lead waveform region images in row units, each lead waveform region image comprising a plurality of lead signals; segmenting each lead waveform region image into a plurality of lead waveform subregion images corresponding to each lead signal; acquiring pixel point positions of lead waveforms in the lead waveform subregion images; obtaining an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position; obtaining an interval for restoring the lead signals based on the total number of pixels of the lead waveforms in the acquired lead waveform subregion image; and generating a reduction lead signal based on the pixel point position, the amplitude value and the interval. High reduction degree of the lead signal is ensured, and the operation is simple and more accurate.

Description

Electrocardiogram processing method and device
Technical Field
The invention relates to the technical field of image processing, in particular to an electrocardiogram processing method and device.
Background
With the development of digital medical treatment, big data and computer technology, various hospital information management systems are widely applied, and the established patient health information database can inquire and trace the health information of patients and realize resource sharing and expert remote diagnosis by utilizing the Internet. The electrocardiogram is an important examination means for diagnosing heart diseases, as a noninvasive, accurate and rapid detection method, a large number of electrocardiogram reports are generated every day in hospitals, most of the electrocardiogram reports are recorded by thermosensitive printing paper, and due to the chemical characteristics of the thermosensitive printing paper, the storage condition and the long time, the color of a printing curve becomes light, the picture quality becomes poor, even the paper is damaged, so that typical clinical electrocardiogram signals cannot be stored for a long time. China is large in population quantity and has massive pathological electrocardiosignals. 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 and then is filed in a certain format. The digitalized electrocardiosignals are beneficial to the management of patients information by hospitals and the teaching and scientific research of clinicians, doctors can also utilize a large amount of obtained data to carry out more refined quantitative statistical analysis and diagnosis on heart diseases, more and more accurate clinical diagnosis standards are developed, the diagnosis accuracy of the patient's condition is improved, and a better treatment scheme is provided.
The existing curve digitalization processing method of the electrocardiogram drawing is a point tracking method, a window tracking method and a prediction search method of the curve, the possible position of the next point is mainly presumed according to the known point on the electrocardiogram track, whether the gray levels of the next point and the current point are close or not needs to be judged in the processing process, and threshold processing is carried out; when the tracking point is at the base line position with slow change and at the position with sharp change of the rising and falling of the peak, different model methods are adopted for processing, and the methods are essentially morphological approximate processing methods, the processing process is complex, the calculation amount is large, and the quantization error is large.
Disclosure of Invention
The present invention aims to provide an electrocardiogram processing method and device to improve the above problems. In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, an embodiment of the present invention provides an electrocardiogram processing method, where the method includes performing separation processing on a read paper electrocardiogram image to obtain a lead curve region image of the paper electrocardiogram image; separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images comprising a plurality of lead signals; segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals; acquiring pixel point positions of the lead waveforms in the lead waveform subregion image; obtaining an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position; obtaining an interval for the restored lead signals based on a total number of pixels of the lead waveforms in the acquired lead waveform sub-region image; generating the restore lead signal based on the pixel point locations, the amplitude values, and the intervals.
In a second aspect, an embodiment of the present invention provides an electrocardiogram processing apparatus, which includes a first acquisition unit, a separation unit, a segmentation unit, a second acquisition unit, a third acquisition unit, a fourth acquisition unit, and a generation unit. And the first acquisition unit is used for separating the read paper electrocardiogram image to obtain a lead curve area image of the paper electrocardiogram image. And the separation unit is used for separating the lead curve area image into a plurality of lead waveform area images in a row unit, and each lead waveform area image comprises a plurality of lead signals. A segmentation unit for segmenting each of the lead waveform region images into a plurality of lead waveform subregion images corresponding to each of the lead signals. And the second acquisition unit is used for acquiring the positions of the pixel points of the lead waveforms in the lead waveform subregion image. And the third acquisition unit is used for acquiring the amplitude value of the restored lead signal based on the lead curve area image and the pixel point position. And the fourth acquisition unit is used for acquiring the interval of the lead signal reduction based on the total number of pixels of the lead waveform in the acquired lead waveform subregion image. A generating unit for generating the restore lead signal based on the pixel point position, the amplitude value and the interval.
The embodiment of the invention provides an electrocardiogram processing method and device, which are used for separating read paper electrocardiogram images to obtain lead curve area images of the paper electrocardiogram images; separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images comprising a plurality of lead signals; segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals; acquiring pixel point positions of the lead waveforms in the lead waveform subregion image; obtaining an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position; obtaining an interval for the restored lead signals based on a total number of pixels of the lead waveforms in the acquired lead waveform sub-region image; generating the restore lead signal based on the pixel point locations, the amplitude values, and the intervals. High reduction degree of the lead signal is ensured, and the operation is simple and more accurate.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
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 an electronic device that may be used in embodiments of the invention;
FIG. 2 is a flowchart of a method for processing an electrocardiogram according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a sub-region image of a lead waveform to be processed in the electrocardiogram processing method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a sub-region image of a lead waveform in the electrocardiogram processing method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the restored lead signals generated by the electrocardiogram processing method according to the embodiment of the present invention;
fig. 6 is a schematic diagram of a read paper electrocardiogram I-lead according to an embodiment of the present invention;
fig. 7 is a block diagram of an electrocardiogram processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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 given herein 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.
Fig. 1 shows a block diagram of an electronic device 100 applicable to an embodiment of the present invention. As shown in fig. 1, electronic device 100 may include a memory 102, a memory controller 104, one or more processors 106 (only one shown in fig. 1), a peripherals interface 108, an input-output module 110, an audio module 112, a display module 114, a radio frequency module 116, and an electrocardiogram processing apparatus.
The memory 102, the memory controller 104, the processor 106, the peripheral interface 108, the input/output module 110, the audio module 112, the display module 114, and the radio frequency module 116 are electrically connected directly or indirectly to realize data transmission or interaction. For example, electrical connections between these components may be made through one or more communication or signal buses. The electrocardiogram processing method comprises at least one software functional module which can be stored in the memory 102 in the form of software or firmware (firmware), for example, a software functional module or a computer program comprised by the electrocardiogram processing apparatus.
The memory 102 may store various software programs and modules, such as program instructions/modules corresponding to the electrocardiogram processing method and apparatus provided by the embodiments of the present application. The processor 106 executes various functional applications and data processing by executing software programs and modules stored in the memory 102, that is, implements the electrocardiogram processing method in the embodiment of the present application.
The Memory 102 may include, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read Only Memory (PROM), Erasable Read Only Memory (EPROM), electrically Erasable Read Only Memory (EEPROM), and the like.
The processor 106 may be an integrated circuit chip having signal processing capabilities. The processor 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. Which may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The peripherals interface 108 couples various input/output devices to the processor 106 and to the memory 102. In some embodiments, the peripheral interface 108, the processor 106, and the memory controller 104 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The input-output module 110 is used for providing input data to a user to enable the user to interact with the electronic device 100. The input/output module 110 may be, but is not limited to, a mouse, a keyboard, and the like.
Audio module 112 provides an audio interface to a user that may include one or more microphones, one or more speakers, and audio circuitry.
The display module 114 provides an interactive interface (e.g., a user interface) between the electronic device 100 and a user or for displaying image data to a user reference. In this embodiment, the display module 114 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 106 for calculation and processing.
The rf module 116 is used for receiving and transmitting electromagnetic waves, and implementing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices.
It will be appreciated that the configuration shown in FIG. 1 is merely illustrative and that electronic device 100 may include more or fewer components than shown in FIG. 1 or have a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
In the embodiment of the invention, the electronic device 100 may be a user terminal or a server. The user terminal may be a pc (personal computer), a tablet computer, a mobile phone, a notebook computer, an intelligent television, a set-top box, a vehicle-mounted terminal, and other terminal devices.
Referring to fig. 2, an embodiment of the present invention provides an electrocardiogram processing method, which includes step S200, step S210, step S220, step S230, step S240, step S250, and step S260.
Step S200: and separating the read paper electrocardiogram image to obtain a lead curve area image of the paper electrocardiogram image.
Based on the step S200, further removing the background grid in the paper electrocardiogram image to obtain a first curved text information image of the paper electrocardiogram image; filtering the first curve character information image to obtain a second curve character information image; and processing the second curve character information image according to a projection contour method to obtain a lead curve area image of the paper electrocardiogram image.
The thermal printing paper of the paper electrocardiogram image is a light red background grid, and the printed curves and characters are black. The picture of the printed report is a color picture, and according to the RGB composite color image principle, the threshold value of the picture at R, G, B layer is obviously different between the light red background grid and the black curve. Further, obtaining a background grid in the paper electrocardiogram image and a gray value range of foreground curve characters in the paper electrocardiogram image; and according to a threshold value method, removing the background grids in the paper electrocardiogram image, and then obtaining a first curve character information image of the paper electrocardiogram image. The first curve text information image, i.e., P1, is a black and white picture including curves and text, the curves and text are white with a gray scale value of 255, the background process is black with a gray scale value of 0.
Furthermore, because of the difference between the resolution of the image and the resolution of the laser printer, scattered noise signals may exist in the first curve text information image, and in order to obtain a clean and complete curve, the median filtering processing is performed on the first curve text information image to obtain a second curve text information image.
Further, according to the particularity of the second curved text information image, certain spacing gaps exist between text lines and curved line regions in the second curved text information image, the text lines and the curved line regions are distributed in a rectangular mode, the second curved text information image is projected to the Y axis by a projection contour method, 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 larger than 0, the line position is indicated to be a blank boundary region, so that the upper boundary and the lower boundary of the whole region of the lead curve in the second curved text information image are found, a lead curve region image containing the lead curve is generated, and the lead curve region image of the electrocardiogram paper image, namely P2, is obtained.
Step S210: separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images comprising a plurality of lead signals.
Based on step S210, further, according to the upper and lower boundary positions of the lead curve region image, dividing the whole search region into a plurality of equal parts, each equal part being a row search region for searching the maximum amplitude position of the plurality of lead signals in each row;
projecting the line search areas corresponding to the plurality of equal divisions to the Y axis, and taking the pixel and the position with the maximum accumulation in each found line search area as a first reference point;
and searching downwards a lead ending position of a projection Y axis in a preset search range based on the first reference point, and recording the lower boundary position of each row of lead signals until a plurality of lead waveform area images are obtained.
In the present embodiment, the plurality is 4. The lead curve region image is a 3 × 4+1 printing mode, namely: there are 4 lead signals per row, plus the rhythm leads, for a total of 4 row sub-regions. The lead curve region image, P2, is partitioned into 4 lead waveform region images, P2_1, P2_2, P2_3, P2_4, in units of rows.
Step S220: segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals.
A lead separator is arranged between a plurality of lead signals in each lead waveform region image, a lead symbol is arranged above the initial position of each lead signal, and each lead waveform region image is further projected to the X axis based on the step S220; obtaining a reference position of the lead symbol according to the characteristics of the lead symbol and the lead separator, searching the position of a point with a peak value exceeding a preset threshold value in a left preset window range by taking the reference position as a second reference point, recording the position as the lead separator, and dividing the position into a plurality of lead waveform subarea images to be processed corresponding to each lead signal; projecting the lead waveform subregion image to be processed to the Y axis, and obtaining the starting position and the ending position of the height of the lead symbol according to the sudden change characteristic of the lead symbol and the projection pixel superposition curve of the lead waveform; projecting the lead waveform subregion image to be processed to an X axis, separating out lead waveforms and lead separators, and obtaining the starting positions and the ending positions of the lead waveforms; obtaining a lead waveform sub-region image based on the lead symbol height starting and ending positions, the lead waveform sub-region image including the lead waveform.
Specifically, the characteristics of the lead symbols are: after the lead symbols are projected to the X-axis, the pixel integration and curve are dense and the amplitude is low. The lead separators are characterized by: after the lead separator is projected to the X-axis, the pixel accumulation sum curve amplitude is large, and is an obvious peak. One of the lead waveform region images, such as P2_1, is divided into 4 lead waveform sub-region images corresponding to each of the lead signals, namely P2_1_1, P2_1_2, P2_1_3, P2_1_ 4. As shown in FIG. 3, the lead waveform subregion image to be processed contains a lead symbol I and a partial lead separator. As shown in FIG. 4, the lead waveform sub-region image includes only lead waveforms.
Step S230: and acquiring the positions of the pixel points of the lead waveforms in the lead waveform subregion image.
Because of the resolution of the print head, each sample point signal is actually printed as a column of multiple pixels, and multiple pixel values of a column need to be processed to a position of 1 pixel. In the abrupt change positions of the rising and falling of the lead waveform, the pixels of the waveform are dense and large in number, and in order to avoid amplitude reduction errors caused by processing, the uppermost peripheral pixel is required to be taken in the area where the lead waveform is in the peak value, and the lowermost peripheral pixel is required to be taken in the area where the waveform is in the trough.
Further, the lead waveforms in the lead waveform sub-area image are projected to the Y-axis direction, the baseline position is found according to the characteristics of the lead waveforms, the baseline position is used as a third reference point, the pixel processing above the baseline position is the top peripheral pixel position, the pixel processing below the baseline position is the bottom peripheral pixel position, the average pixel position near the baseline position is taken, and all pixel point positions of the lead waveforms are obtained.
Step S240: and obtaining an amplitude value of the restored lead signal based on the lead curve area image and the pixel point position.
Further, obtaining the position of a calibration symbol in the lead curve area image; obtaining the number of pixels contained in the height of the scaling symbol according to the position of the scaling symbol; obtaining the pixel resolution of a single pixel based on the number of pixels contained in the height of the scaling symbol; and calculating the relative amplitude of the restored lead signal by taking the pixel point position as a fourth reference point, and then obtaining the amplitude value of the restored lead signal based on the pixel resolution and the relative amplitude.
For example, the height of the scaling symbol comprises 120 pixels, which represents 1mv, the sensitivity of the scaling symbol is 10mm/mv, and the pixel resolution of a single pixel is: 1/120 is approximately equal to 8.3 multiplied by 10-3 mv; calculating the relative amplitude of the restored lead signal by taking the pixel point position as a fourth reference point; and multiplying the relative amplitude by the pixel resolution to obtain a product which is used for restoring the amplitude value of the lead signal, namely obtaining the amplitude value of the restored lead signal.
Step S250: obtaining an interval for the restored lead signals based on a total number of pixels of the lead waveforms in the acquired lead waveform sub-region image.
Further, interpolation processing is carried out on the actual printing time of the obtained paper electrocardiogram image and the total number of pixels of the lead waveform, and an interval of the restored lead signal is obtained.
Step S260: generating the restore lead signal based on the pixel point locations, the amplitude values, and the intervals.
For example, each lead waveform is 2.5s, the sampling rate is 500, and the total number of pixels of the lead waveform is interpolated to 1250 points, i.e. the whole lead waveform can be restored to an actual sampling signal. As can be seen from comparison between the restored I-lead signal generated in fig. 5 and the originally read I-lead of the paper electrocardiogram image in fig. 6, the electrocardiogram processing method provided by the embodiment of the present invention can perfectly and completely restore the paper centroid electrogram waveform.
To further illustrate the beneficial effects of the electrocardiogram processing method provided by the embodiment of the invention, as shown in tables 1, 2 and 3, case numbers 1-12 represent 12 paper electrocardiograms, reference P-wave amplitude represents P-wave amplitude on each paper electrocardiogram image, restored P-wave amplitude represents P-wave amplitude corresponding to the restored lead signals obtained by implementing the electrocardiogram processing method of the invention, P-wave amplitude difference represents difference between reference P-wave amplitude and restored P-wave amplitude, reference Q-wave amplitude represents Q-wave amplitude on each paper electrocardiogram image, restored Q-wave amplitude represents Q-wave amplitude corresponding to the restored lead signals obtained by implementing the electrocardiogram processing method of the invention, Q-wave amplitude difference represents difference between reference Q-wave amplitude and restored Q-wave amplitude, reference R-wave amplitude represents R-wave amplitude on each paper electrocardiogram image, the R wave amplitude reduction value represents the R wave amplitude value of the reduction lead signal correspondingly obtained by implementing the electrocardiogram processing method, the R wave amplitude difference value represents the difference value between the reference R wave amplitude value and the reduction R wave amplitude value, the reference S wave amplitude value represents the S wave amplitude value on each paper electrocardiogram image, the S wave amplitude reduction value represents the S wave amplitude value of the reduction lead signal correspondingly obtained by implementing the electrocardiogram processing method, the S wave amplitude difference value represents the difference value between the reference S wave amplitude value and the reduction S wave amplitude value, the reference T wave amplitude value represents the T wave amplitude value on each paper electrocardiogram image, the T wave amplitude reduction value represents the T wave amplitude value of the reduction lead signal correspondingly obtained by implementing the electrocardiogram processing method, and the T wave amplitude difference value represents the difference value between the reference T wave amplitude value and the reduction T wave amplitude value.
Through P, Q, R, S, T wave amplitudes in tables 1-3, each amplitude error is lower than 0.1mv, the difference of P, Q, S, T wave amplitudes is very small and lower than 0.05mv, except for the case of No. 3, the P wave amplitude is too small, so that the measuring and diagnosing machine has errors in calculating the P wave amplitude, the heart rate difference is very small through comparing the heart rate, the PR interval, the QRS interval and the QT interval in table 4, the difference of other intervals is within 30ms, and the recalculation accuracy after data reduction is very high. Therefore, the doctor or the instrument can ensure the accuracy of the diagnosis conclusion when carrying out re-analysis and treatment.
Table 1 case amplitude value comparison 1
Figure BDA0001413042870000121
Table 2 case amplitude value comparison 2
Figure BDA0001413042870000122
Table 3 case amplitude value comparison 3
Case number Reference T wave amplitude (mv) Reduction T wave amplitude (mv) T wave amplitude difference (mv)
1 0.2294 0.2052 0.0242
2 0.4904 0.436 0.0544
3 0.3788 0.3234 0.0554
4 0.2168 0.1868 0.03
6 0.383 0.3254 0.0576
7 0.2748 0.235 0.0398
8 0.1096 0.094 0.0156
10 0.5478 0.4674 0.0804
11 0.1318 0.1046 0.0272
12 0.255 0.217 0.038
TABLE 4 interpatient comparisons
Figure BDA0001413042870000131
The embodiment of the invention provides an electrocardiogram processing method and device, which are used for separating read paper electrocardiogram images to obtain lead curve area images of the paper electrocardiogram images; separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images comprising a plurality of lead signals; segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals; acquiring pixel point positions of the lead waveforms in the lead waveform subregion image; obtaining an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position; obtaining an interval for the restored lead signals based on a total number of pixels of the lead waveforms in the acquired lead waveform sub-region image; generating the restore lead signal based on the pixel point locations, the amplitude values, and the intervals. High reduction degree of the lead signal is ensured, and the operation is simple and more accurate.
Referring to fig. 7, an example of the present invention provides an electrocardiogram processing apparatus 300, where the apparatus 300 may include: a first acquisition unit 310, a partitioning unit 320, a dividing unit 330, a second acquisition unit 340, a third acquisition unit 350, a fourth acquisition unit 360, and a generation unit 370.
The first obtaining unit 310 is configured to perform separation processing on the read paper-based electrocardiogram image to obtain a lead curve region image of the paper-based electrocardiogram image.
The first acquisition unit 310 may include a first acquisition sub-unit 311.
The first obtaining subunit 311 is configured to remove the background grid in the paper electrocardiogram image, and obtain a first curved text information image of the paper electrocardiogram image; filtering the first curve character information image to obtain a second curve character information image; and processing the second curve character information image according to a projection contour method to obtain a lead curve area image of the paper electrocardiogram image.
The first obtaining subunit 311 is further configured to obtain a background grid in the paper electrocardiogram image and a gray value range of foreground curve characters in the paper electrocardiogram image; and according to a threshold value method, removing the background grids in the paper electrocardiogram image, and then obtaining a first curve character information image of the paper electrocardiogram image.
The first obtaining subunit 311 is further configured to perform median filtering on the first curved text information image to obtain a second curved text information image.
A separation unit 320 for separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images including a plurality of lead signals.
The separation unit 320 may include a separation subunit 321.
A dividing subunit 321, configured to divide the entire search area into a plurality of equal parts according to the upper and lower boundary positions of the lead curve area image, where each equal part is used as a row search area for searching the maximum amplitude position of each row of the plurality of lead signals; projecting the line search areas corresponding to the plurality of equal divisions to the Y axis, and taking the pixel and the position with the maximum accumulation in each found line search area as a first reference point; and searching downwards a lead ending position of a projection Y axis in a preset search range based on the first reference point, and recording the lower boundary position of each row of lead signals until a plurality of lead waveform area images are obtained.
A segmentation unit 330 for segmenting each of the lead waveform region images into a plurality of lead waveform subregion images corresponding to each of the lead signals.
Lead separators are arranged between adjacent lead signals in each lead waveform region image, and a lead symbol is arranged above the starting position of each lead signal. The dividing unit 330 may include a dividing sub-unit 331.
A segmentation subunit 331 configured to project each of the lead waveform region images to the X-axis; obtaining a reference position of the lead symbol according to the characteristics of the lead symbol and the lead separator, searching the position of a point with a peak value exceeding a preset threshold value in a left preset window range by taking the reference position as a second reference point, recording the position as the lead separator, and dividing the position into a plurality of lead waveform subarea images to be processed corresponding to each lead signal; projecting the lead waveform subregion image to be processed to the Y axis, and obtaining the starting position and the ending position of the height of the lead symbol according to the sudden change characteristic of the lead symbol and the projection pixel superposition curve of the lead waveform; projecting the lead waveform subregion image to be processed to an X axis, separating out lead waveforms and lead separators, and obtaining the starting positions and the ending positions of the lead waveforms; obtaining a lead waveform sub-region image based on the lead symbol height starting and ending positions, the lead waveform sub-region image including the lead waveform.
And the second obtaining unit 340 is configured to obtain positions of pixel points of the lead waveform in the lead waveform subregion image.
The second acquisition unit 340 may include a second acquisition subunit 341.
The second obtaining subunit 341 is configured to project the lead waveforms in the lead waveform sub-region image to the Y-axis direction, find a base line position according to the characteristics of the lead waveforms, use the base line position as a third reference point, process pixels above the base line position to obtain an uppermost peripheral pixel position, process pixels below the base line position to obtain a lowermost peripheral pixel position, and obtain an average pixel position near the base line position to obtain all pixel point positions of the lead waveforms.
A third obtaining unit 350, configured to obtain an amplitude value of the restored lead signal based on the lead curve region image and the pixel point position.
The third acquisition unit 350 may include a third acquisition sub-unit 351.
A third obtaining subunit 351, configured to obtain, in the lead curve region image, a position of a calibration symbol; obtaining the number of pixels contained in the height of the scaling symbol according to the position of the scaling symbol; obtaining the pixel resolution of a single pixel based on the number of pixels contained in the height of the scaling symbol; and calculating the relative amplitude of the restored lead signal by taking the pixel point position as a fourth reference point, and then obtaining the amplitude value of the restored lead signal based on the pixel resolution and the relative amplitude.
A fourth obtaining unit 360, configured to obtain the interval of the restored lead signal based on the total number of pixels of the lead waveform in the acquired lead waveform sub-region image.
The fourth acquiring unit 360 may include a fourth acquiring sub-unit 361.
A fourth obtaining subunit 361, configured to obtain the interval of the restored lead signal by performing interpolation processing on the actual printing time of the obtained paper electrocardiogram image and the total number of pixels of the lead waveform.
A generating unit 370 for generating the restore lead signal based on the pixel point positions, the amplitude values and the intervals.
The above units may be implemented by software codes, and in this case, the above units may be stored in the memory 102. The above units may also be implemented by hardware, for example, an integrated circuit chip.
The implementation principle and the resulting technical effect of the electrocardiogram processing apparatus 300 according to the embodiment of the present invention are the same as those of the foregoing method embodiments, and for the sake of brief description, no mention is made in the apparatus embodiment, and reference may be made to the corresponding contents in the foregoing method embodiments.
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.
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.

Claims (9)

1. A method of processing an electrocardiogram, the method comprising:
separating the read paper electrocardiogram image to obtain a lead curve area image of the paper electrocardiogram image;
separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images comprising a plurality of lead signals;
segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals;
acquiring pixel point positions of the lead waveforms in the lead waveform subregion image;
obtaining an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position;
obtaining an interval for the restored lead signals based on a total number of pixels of the lead waveforms in the acquired lead waveform sub-region image;
generating the restore lead signal based on the pixel point locations, the amplitude values, and the intervals;
separating the lead curve region image into a plurality of lead waveform region images in row units, including:
dividing the whole search area into a plurality of equal parts according to the upper and lower boundary positions of the lead curve area image, wherein each equal part is used as a line search area for searching the maximum amplitude position of a plurality of lead signals in each line;
projecting the line search areas corresponding to the plurality of equal divisions to the Y axis, and taking the pixel and the position with the maximum accumulation in each found line search area as a first reference point;
and searching downwards a lead ending position of a projection Y axis in a preset search range based on the first reference point, and recording the lower boundary position of each row of lead signals until a plurality of lead waveform area images are obtained.
2. The method according to claim 1, wherein the step of performing separation processing on the read paper electrocardiogram image to obtain a lead curve area image of the paper electrocardiogram image comprises:
removing the background grids in the paper electrocardiogram image to obtain a first curve character information image of the paper electrocardiogram image;
filtering the first curve character information image to obtain a second curve character information image;
and processing the second curve character information image according to a projection contour method to obtain a lead curve area image of the paper electrocardiogram image.
3. The method of claim 2, wherein removing the background grid from the paper electrocardiogram image to obtain the first curved text information image of the paper electrocardiogram image comprises:
acquiring a background grid in the paper electrocardiogram image and a gray value range of foreground curve characters in the paper electrocardiogram image;
and according to a threshold value method, removing the background grids in the paper electrocardiogram image, and then obtaining a first curve character information image of the paper electrocardiogram image.
4. The method of claim 2, wherein filtering the first curved textual information image to obtain a second curved textual information image comprises:
and carrying out median filtering processing on the first curve character information image to obtain a second curve character information image.
5. The method according to claim 1, wherein a plurality of lead signals in each of the lead waveform region images have lead separators between adjacent ones of the lead signals, each lead signal having a lead symbol above a starting position, and segmenting each of the lead waveform region images into a plurality of lead waveform sub-region images corresponding to each of the lead signals, comprises:
projecting each of said lead waveform region images to the X-axis;
obtaining a reference position of the lead symbol according to the characteristics of the lead symbol and the lead separator, searching the position of a point with a peak value exceeding a preset threshold value in a left preset window range by taking the reference position as a second reference point, recording the position as the lead separator, and dividing the position into a plurality of lead waveform subarea images to be processed corresponding to each lead signal;
projecting the lead waveform subregion image to be processed to the Y axis, and obtaining the starting position and the ending position of the height of the lead symbol according to the sudden change characteristic of the lead symbol and the projection pixel superposition curve of the lead waveform;
projecting the lead waveform subregion image to be processed to an X axis, separating out lead waveforms and lead separators, and obtaining the starting positions and the ending positions of the lead waveforms;
obtaining a lead waveform sub-region image based on the lead symbol height starting and ending positions, the lead waveform sub-region image including the lead waveform.
6. The method of claim 1, wherein obtaining pixel point locations of the lead waveform in the lead waveform subregion image comprises:
projecting the lead waveforms in the lead waveform subregion images to the Y-axis direction, finding out a base line position according to the characteristics of the lead waveforms, taking the base line position as a third reference point, processing pixels above the base line position into the uppermost peripheral pixel position, processing pixels below the base line position into the lowermost peripheral pixel position, and taking an average pixel position near the base line position to obtain all pixel point positions of the lead waveforms.
7. The method of claim 6, wherein obtaining amplitude values of restored lead signals based on the lead curve region image and the pixel point positions comprises:
obtaining the position of a calibration symbol in the lead curve area image;
obtaining the number of pixels contained in the height of the scaling symbol according to the position of the scaling symbol;
obtaining the pixel resolution of a single pixel based on the number of pixels contained in the height of the scaling symbol;
and calculating the relative amplitude of the restored lead signal by taking the pixel point position as a fourth reference point, and then obtaining the amplitude value of the restored lead signal based on the pixel resolution and the relative amplitude.
8. The method of claim 1, wherein obtaining the intervals for restoring the lead signals based on a total number of pixels of the lead waveform in the acquired lead waveform subregion image comprises:
and obtaining the interval of the restored lead signals by performing interpolation processing on the actual printing time of the obtained paper electrocardiogram image and the total number of pixels of the lead waveforms.
9. An electrocardiogram processing apparatus, characterized in that it comprises:
the first acquisition unit is used for separating the read paper electrocardiogram image to obtain a lead curve area image of the paper electrocardiogram image;
a separation unit for separating the lead curve region image into a plurality of lead waveform region images in row units, each of the lead waveform region images including a plurality of lead signals;
a segmentation unit for segmenting each of said lead waveform region images into a plurality of lead waveform subregion images corresponding to each of said lead signals;
the second acquisition unit is used for acquiring the pixel point positions of the lead waveforms in the lead waveform subregion image;
the third acquisition unit is used for acquiring an amplitude value of a restored lead signal based on the lead curve area image and the pixel point position;
a fourth obtaining unit, configured to obtain an interval of the restored lead signal based on a total number of pixels of the lead waveform in the obtained lead waveform subregion image;
a generating unit for generating the restore lead signal based on the pixel point position, the amplitude value and the interval;
the partition unit includes: a separator subunit;
the separation subunit is used for dividing the whole search area into a plurality of equal parts according to the upper and lower boundary positions of the lead curve area image, and each equal part is used as a line search area for searching the maximum amplitude position of each line of a plurality of lead signals; projecting the line search areas corresponding to the plurality of equal divisions to the Y axis, and taking the pixel and the position with the maximum accumulation in each found line search area as a first reference point; and searching downwards a lead ending position of a projection Y axis in a preset search range based on the first reference point, and recording the lower boundary position of each row of lead signals until a plurality of lead waveform area images are obtained.
CN201710870201.0A 2017-09-20 2017-09-20 Electrocardiogram processing method and device Active CN107625519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710870201.0A CN107625519B (en) 2017-09-20 2017-09-20 Electrocardiogram processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710870201.0A CN107625519B (en) 2017-09-20 2017-09-20 Electrocardiogram processing method and device

Publications (2)

Publication Number Publication Date
CN107625519A CN107625519A (en) 2018-01-26
CN107625519B true CN107625519B (en) 2020-09-08

Family

ID=61103824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710870201.0A Active CN107625519B (en) 2017-09-20 2017-09-20 Electrocardiogram processing method and device

Country Status (1)

Country Link
CN (1) CN107625519B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109480824B (en) * 2018-12-11 2021-10-08 武汉中旗生物医疗电子有限公司 Method and device for processing electrocardio waveform data and server
CN109480825B (en) * 2018-12-13 2021-08-06 武汉中旗生物医疗电子有限公司 Electrocardio data processing method and device
CN113077472B (en) * 2021-04-07 2023-02-10 华南理工大学 Paper electrocardiogram curve image segmentation method, system, device and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI378789B (en) * 2008-05-30 2012-12-11 Univ Yuan Ze Mobile- and web-based 12-lead ecg management information system
CN102038498A (en) * 2011-01-20 2011-05-04 天津理工大学 Method for digitalizing paper electrocardiogram
KR101554381B1 (en) * 2012-07-30 2015-09-18 가톨릭대학교 산학협력단 Method and apparatus for performing fetal health
CN106326818B (en) * 2015-06-30 2019-10-15 东南大学 The digitizing solution and device of papery hydrological data
CN106202948B (en) * 2016-07-18 2018-12-18 上海市第一人民医院 A kind of method for digitizing echocardiogram report and managing automatically

Also Published As

Publication number Publication date
CN107625519A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
Wang et al. Automatic ECG classification using continuous wavelet transform and convolutional neural network
CN107625519B (en) Electrocardiogram processing method and device
Samol et al. Recording of bipolar multichannel ECGs by a smartwatch: modern ECG diagnostic 100 years after Einthoven
Höller et al. Comparison of EEG-features and classification methods for motor imagery in patients with disorders of consciousness
US20210204884A1 (en) System and methods for electrocardiogam beat similarity analysis using deep neural networks
US20120321189A1 (en) Systems and methods for automated extraction of measurement information in medical videos
Cuesta-Frau et al. Embedded dimension and time series length. Practical influence on permutation entropy and its applications
Leite et al. Heartbeat classification with low computational cost using Hjorth parameters
Rahman et al. Robustness of electrocardiogram signal quality indices
Mohd Apandi et al. An analysis of the effects of noisy electrocardiogram signal on heartbeat detection performance
Khan et al. Robust extraction of P300 using constrained ICA for BCI applications
Wu et al. A fully-automated paper ECG digitisation algorithm using deep learning
Neshitov et al. Wavelet analysis and self-similarity of photoplethysmography signals for HRV estimation and quality assessment
Jallouli et al. Clifford wavelet entropy for fetal ECG extraction
Navratilova et al. Grids from bands, or bands from grids? An examination of the effects of single unit contamination on grid cell firing fields
KR101977745B1 (en) Method and apparatus for classifying cardiac arrhythmia
CN107622245B (en) Paper waveform extraction method and device
Abdullah Al et al. Improving R peak detection in ECG signal using dynamic mode selected energy and adaptive window sizing algorithm with decision tree algorithm
Galli et al. Dedicated algorithm for unobtrusive fetal heart rate monitoring using multiple dry electrodes
Mandala et al. The effects of Daubechies wavelet basis function (DWBF) and decomposition level on the performance of artificial intelligence-based atrial fibrillation (AF) detection based on electrocardiogram (ECG) signals
CN112869753B (en) Analysis method, equipment, medium and electrocardiograph for QRST waveform of electrocardiogram
Le et al. A dynamic systems approach for detecting and localizing of infarct-related artery in acute myocardial infarction using compressed paper-based electrocardiogram (ecg)
Espinosa et al. Effects of tau and sampling frequency on the regularity analysis of ecg and eeg signals using apen and sampen entropy estimators
Shrivastava et al. Digitization of ECG paper records using MATLAB
Zhao et al. Suppressing the influence of ectopic beats by applying a physical threshold-based sample entropy

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