Simple image processing solution in python for mea

2019-08-17 00:54发布

问题:

I have a MacOS 10.13.4 and I want to write a GUI in python3 able to measure measure intervals on a scanned Electrocardiogram or ECG (hear rhythm of a patient). I have some programming knowledge in python but I'm not a professional computer scientist

For this I need to do the following steps:

  1. Rotation: Rotate the image so that the ECG baseline is pefectly horizontal (because the ECG on the scan can be a little rotated by a few degrees of angle). Here is an image of an ECG which needs to be rotated:

  2. Set the scale: As an ECG paper has always a system of grid squares which defines the time on the horizontal axis (40ms for a small square and 200ms for a big square) and the the amplitude of the signal in mV in the vertical axis (0.1mv for a big square). I want to measure unit time an unit amplitude and set it as reference. Here is an image of the scale

  3. Measure intervals: Measure the different in terms of time interval and amplitude difference of the difference ECG points (P Wave, QRS, T Wave). Here is an image of the different intervals:

For the GUI, I'm thinking using Tkinter (any other thoughts)

What would be a simple Solution for this in terms of image processing: - I tried to install openCV but got stuck in the install openCV - Is Python Imaging Library - PIL a good alternative - Any other thoughts?

Many thanks in advance!