Insomnia Data Analysis and Automation Project
In this project, I developed a fully automated system to extract and analyze sleep data from images, with a focus on insomnia research. The project involved processing images from sleep tracking applications, such as Samsung Health, and converting the data into structured formats for further analysis.
Visit githubExtracting Sleep Period
This is example of source data image, as you can see here given: Sleep period, overall time of sleep, 4 Sleeps stages and graph. Here I used "Tesseract" to extract sleep period and added it to image file name, to use it further.
Cropping Graph
After extracting sleep period time and adding it on file name, I dont need other text information, so I cropped graph.
Grayscaling
Here I converted RGB image into Grayscale, and changed each image width to equal sleep minute(in first step I added sleep time into file name).
Creating CSV
This is How final CSV file looks like. It has 3 column and rows count is equal to sleep period of each image. If sleep period 7hr (7x60=420), row count will be 420 also.
Visualization
This is last visualization. I tried show accuracy between source file and CSV. graph on below made from CSV information. Accuracy result is quite high.






