# How to extract a time series from an image?

**URL:** <https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893>\
**Category:** New to Julia\
**Tags:** question, package, images, time-series\
**Created:** [August 13, 2020, 6:45pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893 "2020-08-13T18:45:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [August 13, 2020, 6:45pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/1 "2020-08-13T18:45:43Z")

</div>

Hi everybody,

I’d like to obtain a time series from the image of a signal.

I have a really old paper that includes a Figure from where I need to extract and analyse a 10[s] epoch that became gold standard.

So I need something like:

```julia
using ThePackageINeed

myimage=read("./image_from_old_paper.png")

a=ThePackageINeed.superfunction(myimage)
a|>typeof|>println

Vector

```

Does anybody know how to do that?

Thank you

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [August 13, 2020, 7:01pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/2 "2020-08-13T19:01:36Z")

</div>

I don’t know whether there is a Julia package, but I often use [WebPlotDigitizer - Extract data from plots, images, and maps](https://automeris.io/WebPlotDigitizer/) for digitizing plots. It’s got a weird learning curve, but should be straightforward for your case.

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [August 13, 2020, 7:08pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/3 "2020-08-13T19:08:15Z")

</div>

Thanks for the tip @affans  
It looks really good.

I guess it would be quiet useful to have something like that in Julia.

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [August 13, 2020, 7:10pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/4 "2020-08-13T19:10:09Z")

</div>

The problem is there is a lot of manual adjustments that are usually required when digitizing it like that. It would require some serious fancy algorithms to automatically detect axis, points and recreate the original dataset.

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [August 13, 2020, 7:23pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/5 "2020-08-13T19:23:14Z")

</div>

I understand what you mean.

Maybe some sort of Julia workaround??  
To exploit a relevant package?? Images.jl?  
Metapackages?

I am just brainstorming, I do not really know how to solve it.

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [August 13, 2020, 8:28pm UTC](https://discourse.julialang.org/t/how-to-extract-a-time-series-from-an-image/44893/6 "2020-08-13T20:28:46Z")

</div>

I used a similar tool once, when I needed to extract some loudspeaker frequency characteristics out of a datasheet. I had to manually define the axis limits and to color pick the graph for extraction.  
I would follow a similar semi-automatic method in Julia.  
Click on the axis ticks/limits, make a popup appear to enter the values. Then process the image(probably binarize it), isolate the plot line(maybe guide it a bit with some clicks) and then map the pixel coordinates on the limits from above.

I’m not aware of such a high level function in Julia.

The click on image/popup can be achieved with GtkReactive and the image processing with the suite from Images(ImageTransformations &co)
