Skip to content

Julia package to allow plots to be overlaid on calibrated images

License

Notifications You must be signed in to change notification settings

phajy/Overlay.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overlay

Build Status

Example usage:

using Overlay
using Images
using Plots

# load an image
img = load("test_plot.png")
# calibrate the image scale
(x_scale, y_scale, ar) = calibrate_image(img)
# plot the image with this scale
plot(x_scale, y_scale, reverse(img, dims = 1), yflip = false, aspect_ratio = ar)
# overplot something of interest to compare to the backgorund image
plot!(1.5*rand(10), rand(10), seriestype = :scatter)

When you call calibrate_image you will be asked to click on four points, $x_0$, $x_1$, $y_0$, and $y_1$. An interactive image should appear in a GLMakie window. Note that this can appear behind your IDE window. It is assumed that the image does not need to be rotated and the axes have linear scales. Once you've calibrated your image you'll get an array of $x$ and $y$ values that you can use in, e.g., Plots.jl to overlay a plot on top of the image. The aspect ratio is stored in ar although I'm not certain that is working properly at the moment.

Once the image is calibrated you can plot it as shown in the example above, and then overlay anything you want to compare with this background image.

About

Julia package to allow plots to be overlaid on calibrated images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages